diff options
| author | jvoisin | 2019-10-12 16:13:49 -0700 |
|---|---|---|
| committer | jvoisin | 2019-10-12 16:13:49 -0700 |
| commit | 5f0b3beb46d09af26107fe5f80e63ddccb127a59 (patch) | |
| tree | f3d46e6e9dac60daa304d212bed62b17c019f7eb /tests/test_libmat2.py | |
| parent | 3cef7fe7fc81c1495a461a8594b1df69467536ea (diff) | |
Add a way to disable the sandbox
Due to bubblewrap's pickiness, mat2 can now be run
without a sandbox, even if bubblewrap is installed.
Diffstat (limited to '')
| -rw-r--r-- | tests/test_libmat2.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/test_libmat2.py b/tests/test_libmat2.py index 13d861d..20e6a01 100644 --- a/tests/test_libmat2.py +++ b/tests/test_libmat2.py | |||
| @@ -721,3 +721,43 @@ class TestCleaningArchives(unittest.TestCase): | |||
| 721 | os.remove('./tests/data/dirty.tar.xz') | 721 | os.remove('./tests/data/dirty.tar.xz') |
| 722 | os.remove('./tests/data/dirty.cleaned.tar.xz') | 722 | os.remove('./tests/data/dirty.cleaned.tar.xz') |
| 723 | os.remove('./tests/data/dirty.cleaned.cleaned.tar.xz') | 723 | os.remove('./tests/data/dirty.cleaned.cleaned.tar.xz') |
| 724 | |||
| 725 | class TestNoSandbox(unittest.TestCase): | ||
| 726 | def test_avi_nosandbox(self): | ||
| 727 | shutil.copy('./tests/data/dirty.avi', './tests/data/clean.avi') | ||
| 728 | p = video.AVIParser('./tests/data/clean.avi') | ||
| 729 | p.sandbox = False | ||
| 730 | |||
| 731 | meta = p.get_meta() | ||
| 732 | self.assertEqual(meta['Software'], 'MEncoder SVN-r33148-4.0.1') | ||
| 733 | |||
| 734 | ret = p.remove_all() | ||
| 735 | self.assertTrue(ret) | ||
| 736 | |||
| 737 | p = video.AVIParser('./tests/data/clean.cleaned.avi') | ||
| 738 | self.assertEqual(p.get_meta(), {}) | ||
| 739 | self.assertTrue(p.remove_all()) | ||
| 740 | |||
| 741 | os.remove('./tests/data/clean.avi') | ||
| 742 | os.remove('./tests/data/clean.cleaned.avi') | ||
| 743 | os.remove('./tests/data/clean.cleaned.cleaned.avi') | ||
| 744 | |||
| 745 | def test_png_nosandbox(self): | ||
| 746 | shutil.copy('./tests/data/dirty.png', './tests/data/clean.png') | ||
| 747 | p = images.PNGParser('./tests/data/clean.png') | ||
| 748 | p.sandbox = False | ||
| 749 | p.lightweight_cleaning = True | ||
| 750 | |||
| 751 | meta = p.get_meta() | ||
| 752 | self.assertEqual(meta['Comment'], 'This is a comment, be careful!') | ||
| 753 | |||
| 754 | ret = p.remove_all() | ||
| 755 | self.assertTrue(ret) | ||
| 756 | |||
| 757 | p = images.PNGParser('./tests/data/clean.cleaned.png') | ||
| 758 | self.assertEqual(p.get_meta(), {}) | ||
| 759 | self.assertTrue(p.remove_all()) | ||
| 760 | |||
| 761 | os.remove('./tests/data/clean.png') | ||
| 762 | os.remove('./tests/data/clean.cleaned.png') | ||
| 763 | os.remove('./tests/data/clean.cleaned.cleaned.png') | ||
