summaryrefslogtreecommitdiff
path: root/test/libtest.py
diff options
context:
space:
mode:
authorjvoisin2015-10-05 21:43:17 +0200
committerjvoisin2015-10-05 21:43:17 +0200
commit5b9c600ae96e63f1f7a7f9487512c3c9d8a356e7 (patch)
tree39a2f8e45f4c03f9884de876d44adb5995425b67 /test/libtest.py
parentbeeb5f3f2c43823f51a80c9245af74708c84daa0 (diff)
Tests can now target system-wide or global MAT
$ python test.py --local/--system
Diffstat (limited to 'test/libtest.py')
-rw-r--r--test/libtest.py14
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
10import shutil 10import shutil
11import tarfile 11import tarfile
12import tempfile 12import tempfile
13import test
14import unittest 13import unittest
15 14
16sys.path.append('..') 15import test
16if 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
17import libmat 21import 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')