summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorjvoisin2011-06-10 01:29:29 +0200
committerjvoisin2011-06-10 01:29:29 +0200
commitc308cf7daaa4fa46377e2df0f2e9a397981e19b2 (patch)
treef016ce17cd6747acc068a7d2fc5093d1bd96fa9e /test.py
parentf7082a21d6511c5069fbb9ff186ce22f3e22fed7 (diff)
The current version is (mostly) working
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)