Example #1
0
 def test_check_regular_file(self):
     self.assertEqual(PolyglotLevel(),
                      zip.check('tests/samples/zip/regular.zip'))
Example #2
0
 def test_too_short(self):
     self.assertIsNone(zip.check('tests/samples/zip/too_short'))
Example #3
0
 def test_fake_docx_or_jar(self):
     self.assertEqual(PolyglotLevel(),
                      zip.check('tests/samples/zip/false-docx-jar.zip'))
Example #4
0
 def test_check_apk(self):
     self.assertEqual(PolyglotLevel(embedded={'apk', 'jar'}),
                      zip.check('tests/samples/zip/apk.apk'))
Example #5
0
 def test_check_jar(self):
     self.assertEqual(PolyglotLevel(embedded={'jar'}),
                      zip.check('tests/samples/zip/jar.jar'))
Example #6
0
 def test_check_docx(self):
     self.assertEqual(PolyglotLevel(embedded={'docx'}),
                      zip.check('tests/samples/zip/docx.docx'))
Example #7
0
 def test_check_garbage_at_the_end(self):
     self.assertEqual(PolyglotLevel(suspicious_chunks=[(0xB5, 0x10)]),
                      zip.check('tests/samples/zip/garbage_at_end.zip'))
Example #8
0
 def test_check_garbage_at_the_beginning(self):
     self.assertEqual(
         PolyglotLevel(suspicious_chunks=[(0, 0x8F)]),
         zip.check('tests/samples/zip/garbage_at_beginning.zip'))