summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test.py')
-rw-r--r--test.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/test.py b/test.py
new file mode 100644
index 0000000..3138be7
--- /dev/null
+++ b/test.py
@@ -0,0 +1,29 @@
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 tempfile
11import unittest
12import mat
13
14FILE_LIST = zip(glob.glob('clean*'), glob.glob('dirty*'))
15
16class MATTest(unittest.TestCase):
17 def setUp(self):
18 '''create working copy of the clean and the dirty file in the TMP dir'''
19 self.file_list = []
20 self.tmpdir = tempfile.mkdtemp()
21
22 for clean, dirty in FILE_LIST:
23 shutil.copy2(clean, self.tmpdir + clean)
24 shutil.copy2(dirty, self.tmpdir + dirty)
25 self.file_list.append((self.tmpdir + clean, self.tmpdir + dirty))
26
27 def tearDown(self):
28 '''Remove the tmp folder'''
29 shutil.rmtree(self.tmpdir)