Changeset - 36f09fa6446d
[Not reviewed]
default
0 1 0
domruf - 9 years ago 2017-03-26 15:27:16
dominikruf@gmail.com
tests: don't compare MTIME header of gzip file

The gzip header contains a MTIME part (Modification TIME).
http://www.zlib.org/rfc-gzip.html
Because is takes a little bit of time, from one fill_archive call to the next,
this part may differ and fail the test from time to time.
So we should not include that part in the comparison.
1 file changed with 7 insertions and 1 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/vcs/test_archives.py
Show inline comments
 
@@ -80,7 +80,13 @@ class ArchivesTestCaseMixin(_BackendTest
 
        self.tip.fill_archive(stream=mystream)
 
        mystream.seek(0)
 
        with open(tmppath, 'rb') as f:
 
            self.assertEqual(f.read(), mystream.read())
 
            file_content = f.read()
 
            stringio_content = mystream.read()
 
            # the gzip header contains a MTIME header
 
            # because is takes a little bit of time from one fill_archive call to the next
 
            # this part may differ so don't include that part in the comparison
 
            self.assertEqual(file_content[:4], stringio_content[:4])
 
            self.assertEqual(file_content[8:], stringio_content[8:])
 

	
 
    def test_archive_wrong_kind(self):
 
        with self.assertRaises(VCSError):
0 comments (0 inline, 0 general)