changeset 5744:2d92227f576d

tests: binary streams/files need to be opened in binary mode Without binary, the stream may be closed on EOF character http://stackoverflow.com/a/9069009/7029 .
author domruf <dominikruf@gmail.com>
date Wed, 02 Mar 2016 19:50:51 +0100
parents 20bf8e618bc9
children 83dbf427f1dc
files kallithea/tests/vcs/test_archives.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/tests/vcs/test_archives.py	Wed Mar 02 18:58:25 2016 +0100
+++ b/kallithea/tests/vcs/test_archives.py	Wed Mar 02 19:50:51 2016 +0100
@@ -74,12 +74,12 @@
 
     def test_archive_default_stream(self):
         tmppath = tempfile.mkstemp()[1]
-        with open(tmppath, 'w') as stream:
+        with open(tmppath, 'wb') as stream:
             self.tip.fill_archive(stream=stream)
         mystream = StringIO.StringIO()
         self.tip.fill_archive(stream=mystream)
         mystream.seek(0)
-        with open(tmppath, 'r') as f:
+        with open(tmppath, 'rb') as f:
             self.assertEqual(f.read(), mystream.read())
 
     def test_archive_wrong_kind(self):