diff options
| author | jvoisin | 2011-06-10 01:29:29 +0200 |
|---|---|---|
| committer | jvoisin | 2011-06-10 01:29:29 +0200 |
| commit | c308cf7daaa4fa46377e2df0f2e9a397981e19b2 (patch) | |
| tree | f016ce17cd6747acc068a7d2fc5093d1bd96fa9e /test.py | |
| parent | f7082a21d6511c5069fbb9ff186ce22f3e22fed7 (diff) | |
The current version is (mostly) working
Diffstat (limited to '')
| -rw-r--r-- | test.py | 29 |
1 files changed, 29 insertions, 0 deletions
| @@ -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 | |||
| 8 | import shutil | ||
| 9 | import glob | ||
| 10 | import tempfile | ||
| 11 | import unittest | ||
| 12 | import mat | ||
| 13 | |||
| 14 | FILE_LIST = zip(glob.glob('clean*'), glob.glob('dirty*')) | ||
| 15 | |||
| 16 | class 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) | ||
