diff options
Diffstat (limited to 'test/libtest.py')
| -rw-r--r-- | test/libtest.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/libtest.py b/test/libtest.py index 25d7426..03ae4a1 100644 --- a/test/libtest.py +++ b/test/libtest.py | |||
| @@ -10,10 +10,14 @@ import sys | |||
| 10 | import shutil | 10 | import shutil |
| 11 | import tarfile | 11 | import tarfile |
| 12 | import tempfile | 12 | import tempfile |
| 13 | import test | ||
| 14 | import unittest | 13 | import unittest |
| 15 | 14 | ||
| 16 | sys.path.append('..') | 15 | import test |
| 16 | if test.IS_LOCAL is True: | ||
| 17 | # Are we testing the _local_ version of MAT? | ||
| 18 | sys.path.insert(0, '..') | ||
| 19 | # else it will be in the path | ||
| 20 | |||
| 17 | import libmat | 21 | import libmat |
| 18 | 22 | ||
| 19 | 23 | ||
| @@ -155,12 +159,12 @@ class TestArchiveProcessing(test.MATTest): | |||
| 155 | """ | 159 | """ |
| 156 | tarpath = os.path.join(self.tmpdir, "test.tar.bz2") | 160 | tarpath = os.path.join(self.tmpdir, "test.tar.bz2") |
| 157 | tar = tarfile.open(tarpath, "w") | 161 | tar = tarfile.open(tarpath, "w") |
| 158 | for f in ('../mat.desktop', '../README.security', '../setup.py'): | 162 | for f in ('libtest.py', 'test.py', 'clitest.py'): |
| 159 | tar.add(f, f[3:]) # trim '../' | 163 | tar.add(f, f) |
| 160 | tar.close() | 164 | tar.close() |
| 161 | current_file = libmat.mat.create_class_file(tarpath, False, add2archive=False) | 165 | current_file = libmat.mat.create_class_file(tarpath, False, add2archive=False) |
| 162 | unsupported_files = set(current_file.is_clean(list_unsupported=True)) | 166 | unsupported_files = set(current_file.is_clean(list_unsupported=True)) |
| 163 | self.assertEqual(unsupported_files, {'mat.desktop', 'README.security', 'setup.py'}) | 167 | self.assertEqual(unsupported_files, {'libtest.py', 'test.py', 'clitest.py'}) |
| 164 | 168 | ||
| 165 | def test_archive_unwritable_content(self): | 169 | def test_archive_unwritable_content(self): |
| 166 | path = os.path.join(self.tmpdir, './unwritable_content.zip') | 170 | path = os.path.join(self.tmpdir, './unwritable_content.zip') |
