diff --git a/tests/treq.py b/tests/treq.py index a953a928a..c2b38b857 100644 --- a/tests/treq.py +++ b/tests/treq.py @@ -51,7 +51,7 @@ def __init__(self, fname, expect): with open(self.fname, 'rb') as handle: self.data = handle.read() self.data = self.data.replace(b"\n", b"").replace(b"\\r\\n", b"\r\n") - self.data = self.data.replace(b"\\0", b"\000").replace(b"\\t", b"\t") + self.data = self.data.replace(b"\\0", b"\000").replace(b"\\n", b"\n").replace(b"\\t", b"\t") if b"\\" in self.data: raise AssertionError("Unexpected backslash in test data - only handling HTAB, NUL and CRLF") @@ -273,7 +273,7 @@ def __init__(self, fname): with open(self.fname) as handle: self.data = handle.read() self.data = self.data.replace("\n", "").replace("\\r\\n", "\r\n") - self.data = self.data.replace("\\0", "\000").replace("\\t", "\t") + self.data = self.data.replace("\\0", "\000").replace("\\n", "\n").replace("\\t", "\t") if "\\" in self.data: raise AssertionError("Unexpected backslash in test data - only handling HTAB, NUL and CRLF") self.data = self.data.encode('latin1')