Show More
@@ -17,10 +17,10 b' def test_read_file():' | |||||
17 | read_specified_enc = f.read() |
|
17 | read_specified_enc = f.read() | |
18 | read_detected_enc = openpy.read_py_file(nonascii_path, skip_encoding_cookie=False) |
|
18 | read_detected_enc = openpy.read_py_file(nonascii_path, skip_encoding_cookie=False) | |
19 | nt.assert_equal(read_detected_enc, read_specified_enc) |
|
19 | nt.assert_equal(read_detected_enc, read_specified_enc) | |
20 |
assert |
|
20 | assert 'coding: iso-8859-5' in read_detected_enc | |
21 |
|
21 | |||
22 | read_strip_enc_cookie = openpy.read_py_file(nonascii_path, skip_encoding_cookie=True) |
|
22 | read_strip_enc_cookie = openpy.read_py_file(nonascii_path, skip_encoding_cookie=True) | |
23 |
assert |
|
23 | assert 'coding: iso-8859-5' not in read_strip_enc_cookie | |
24 |
|
24 | |||
25 | def test_source_to_unicode(): |
|
25 | def test_source_to_unicode(): | |
26 | with io.open(nonascii_path, 'rb') as f: |
|
26 | with io.open(nonascii_path, 'rb') as f: | |
@@ -29,4 +29,4 b' def test_source_to_unicode():' | |||||
29 | source_bytes.decode('iso-8859-5').splitlines()) |
|
29 | source_bytes.decode('iso-8859-5').splitlines()) | |
30 |
|
30 | |||
31 | source_no_cookie = openpy.source_to_unicode(source_bytes, skip_encoding_cookie=True) |
|
31 | source_no_cookie = openpy.source_to_unicode(source_bytes, skip_encoding_cookie=True) | |
32 |
nt.assert_not_in( |
|
32 | nt.assert_not_in('coding: iso-8859-5', source_no_cookie) |
General Comments 0
You need to be logged in to leave comments.
Login now