| 1 | Ref https://github.com/jvoisin/mat2/commit/05f34a17695be65b1ad9782911f87e000de8fc8b
|
| 2 | Ref https://github.com/jvoisin/mat2/commit/a69429ce94d739be3dcccc0efeb19820812ac5f4
|
| 3 |
|
| 4 | |
| 5 | |
| 6 | @@ -24,10 +24,11 @@ class TestHelp(unittest.TestCase):
|
| 7 | self.assertIn(b'mat2 [-h] [-V]', stdout)
|
| 8 | self.assertIn(b'[--unknown-members policy]', stdout)
|
| 9 | self.assertIn(b'[--inplace]', stdout)
|
| 10 | - self.assertIn(b' [-v] [-l]', stdout)
|
| 11 | - self.assertIn(b'[--check-dependencies]', stdout)
|
| 12 | + self.assertIn(b'-v', stdout)
|
| 13 | + self.assertIn(b'-l', stdout)
|
| 14 | + self.assertIn(b'--check-dependencies', stdout)
|
| 15 | self.assertIn(b'[-L | -s]', stdout)
|
| 16 | - self.assertIn(b'[files ...]', stdout)
|
| 17 | + self.assertIn(b'files ...', stdout)
|
| 18 |
|
| 19 | def test_no_arg(self):
|
| 20 | proc = subprocess.Popen(mat2_binary, stdout=subprocess.PIPE)
|
| 21 | @@ -35,11 +36,11 @@ class TestHelp(unittest.TestCase):
|
| 22 | self.assertIn(b'mat2 [-h] [-V]', stdout)
|
| 23 | self.assertIn(b'[--unknown-members policy]', stdout)
|
| 24 | self.assertIn(b'[--inplace]', stdout)
|
| 25 | - self.assertIn(b' [-v]', stdout)
|
| 26 | - self.assertIn(b'[-l]', stdout)
|
| 27 | - self.assertIn(b'[--check-dependencies]', stdout)
|
| 28 | + self.assertIn(b'-v', stdout)
|
| 29 | + self.assertIn(b'-l', stdout)
|
| 30 | + self.assertIn(b'--check-dependencies', stdout)
|
| 31 | self.assertIn(b'[-L | -s]', stdout)
|
| 32 | - self.assertIn(b'[files ...]', stdout)
|
| 33 | + self.assertIn(b'files ...', stdout)
|
| 34 |
|
| 35 |
|
| 36 | class TestVersion(unittest.TestCase):
|
| 37 | @@ -223,6 +224,7 @@ class TestGetMeta(unittest.TestCase):
|
| 38 | stdout, _ = proc.communicate()
|
| 39 | self.assertIn(b'Warning: [minor] Improper EXIF header', stdout)
|
| 40 |
|
| 41 | +@unittest.skip("glycin doesn't like some jpg")
|
| 42 | class TestControlCharInjection(unittest.TestCase):
|
| 43 | def test_jpg(self):
|
| 44 | proc = subprocess.Popen(mat2_binary + ['--show', './tests/data/control_chars.jpg'],
|
| 45 | |
| 46 | |
| 47 | @@ -188,15 +188,6 @@ class TestCorruptedFiles(unittest.TestCase):
|
| 48 | audio.MP3Parser('./tests/data/clean.mp3')
|
| 49 | os.remove('./tests/data/clean.mp3')
|
| 50 |
|
| 51 | - def test_wrong_tif(self):
|
| 52 | - shutil.copy('./tests/data/dirty.tiff', './tests/data/clean.tif')
|
| 53 | - p = images.TiffParser('./tests/data/clean.tif')
|
| 54 | - p.remove_all()
|
| 55 | - p = images.TiffParser('./tests/data/clean.cleaned.tif')
|
| 56 | - self.assertEqual(p.get_meta(), {})
|
| 57 | - os.remove('./tests/data/clean.tif')
|
| 58 | - os.remove('./tests/data/clean.cleaned.tif')
|
| 59 | -
|
| 60 | def test_jpg(self):
|
| 61 | shutil.copy('./tests/data/dirty.mp3', './tests/data/clean.jpg')
|
| 62 | with self.assertRaises(ValueError):
|