summaryrefslogtreecommitdiff
path: root/test/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.py')
-rwxr-xr-xtest/test.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/test.py b/test/test.py
new file mode 100755
index 0000000..f095157
--- /dev/null
+++ b/test/test.py
@@ -0,0 +1,31 @@
1'''
2 Class for the testing suite :
3 - get the list of all test files
4 - create a copy of them on start
5 - remove the copy on end
6'''
7
8import shutil
9import glob
10import sys
11import tempfile
12import unittest
13sys.path.append('..')
14from lib import mat
15
16FILE_LIST = zip(glob.glob('clean*'), glob.glob('dirty*'))
17
18class MATTest(unittest.TestCase):
19 def setUp(self):
20 '''create working copy of the clean and the dirty file in the TMP dir'''
21 self.file_list = []
22 self.tmpdir = tempfile.mkdtemp()
23
24 for clean, dirty in FILE_LIST:
25 shutil.copy2(clean, self.tmpdir + clean)
26 shutil.copy2(dirty, self.tmpdir + dirty)
27 self.file_list.append((self.tmpdir + clean, self.tmpdir + dirty))
28
29 def tearDown(self):
30 '''Remove the tmp folder'''
31 shutil.rmtree(self.tmpdir)