Changeset - 2d92227f576d
[Not reviewed]
default
0 1 0
domruf - 10 years ago 2016-03-02 19:50:51
dominikruf@gmail.com
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 .
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/vcs/test_archives.py
Show inline comments
 
@@ -74,12 +74,12 @@ class ArchivesTestCaseMixin(_BackendTest
 

	
 
    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):
0 comments (0 inline, 0 general)