Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,15 @@ def test_with_string_file(self):
# bytes when encoding with utf-8 vs windows-1252 vs utf-16

def test_with_string_file_specified_encoding(self):
content = "\u2122\u20AC\u2030"
content = "\u2122\u20ac\u2030"
file = io.StringIO(content)
file_wrapped = utils.ReadBytesWrapper(file, encoding="utf-16")

# test read() returns specified encoding
self.assertEqual(file_wrapped.read(), content.encode("utf-16"))

def test_with_string_file_detect_encoding(self):
content = "\u2122\u20AC\u2030"
content = "\u2122\u20ac\u2030"
with open(
file=os.path.join(
os.path.dirname(__file__), "test_files", "windows-1252-encoded.txt"
Expand All @@ -214,7 +214,7 @@ def test_with_string_file_detect_encoding(self):
self.assertEqual(file_wrapped.read(), content.encode("windows-1252"))

def test_with_string_file_fallback_encoding(self):
content = "\u2122\u20AC\u2030"
content = "\u2122\u20ac\u2030"
file = io.StringIO(content)
file_wrapped = utils.ReadBytesWrapper(file)

Expand Down