diff options
| author | jvoisin | 2011-07-30 21:47:31 +0200 |
|---|---|---|
| committer | jvoisin | 2011-07-30 21:47:31 +0200 |
| commit | 5715ba52f2238af513b0b87f4aa3c0158d2c84ba (patch) | |
| tree | e77829efd78b1473650a669546c3c11edc37932c /test/test.py | |
| parent | c9cb00bdf702ce6663e78784de63dc6d35c3d875 (diff) | |
Documentation, and removal of unnecessary imports
Diffstat (limited to 'test/test.py')
| -rw-r--r-- | test/test.py | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/test/test.py b/test/test.py index ac63f60..227170b 100644 --- a/test/test.py +++ b/test/test.py | |||
| @@ -12,32 +12,28 @@ import sys | |||
| 12 | import tempfile | 12 | import tempfile |
| 13 | import unittest | 13 | import unittest |
| 14 | 14 | ||
| 15 | sys.path.append('..') | ||
| 16 | from lib import mat | ||
| 17 | |||
| 18 | VERBOSITY = 3 | 15 | VERBOSITY = 3 |
| 19 | FILE_LIST = zip(glob.glob('clean*'), glob.glob('dirty*')) | 16 | FILE_LIST = zip(glob.glob('clean*'), glob.glob('dirty*')) |
| 20 | 17 | ||
| 21 | class MATTest(unittest.TestCase): | 18 | class MATTest(unittest.TestCase): |
| 22 | def setUp(self): | ||
| 23 | ''' | ||
| 24 | Create working copy of the clean and the dirty file in the TMP dir | ||
| 25 | ''' | 19 | ''' |
| 20 | Parent class of all test-functions | ||
| 21 | ''' | ||
| 22 | def setUp(self): | ||
| 23 | ''' | ||
| 24 | Create working copy of the clean and the dirty file in the TMP dir | ||
| 25 | ''' | ||
| 26 | self.file_list = [] | 26 | self.file_list = [] |
| 27 | self.tmpdir = tempfile.mkdtemp() | 27 | self.tmpdir = tempfile.mkdtemp() |
| 28 | 28 | ||
| 29 | for clean, dirty in FILE_LIST: | 29 | for clean, dirty in FILE_LIST: |
| 30 | shutil.copy2(clean, self.tmpdir + os.sep + clean) | 30 | shutil.copy2(clean, self.tmpdir + os.sep + clean) |
| 31 | shutil.copy2(dirty, self.tmpdir + os.sep + dirty) | 31 | shutil.copy2(dirty, self.tmpdir + os.sep + dirty) |
| 32 | |||
| 33 | self.file_list.append((self.tmpdir + os.sep + clean, | 32 | self.file_list.append((self.tmpdir + os.sep + clean, |
| 34 | self.tmpdir + os.sep + dirty)) | 33 | self.tmpdir + os.sep + dirty)) |
| 35 | 34 | ||
| 36 | def tearDown(self): | 35 | def tearDown(self): |
| 37 | ''' | 36 | ''' |
| 38 | Remove the tmp folder | 37 | Remove the tmp folder |
| 39 | ''' | 38 | ''' |
| 40 | for clean, dirty in self.file_list: | ||
| 41 | mat.secure_remove(clean) | ||
| 42 | mat.secure_remove(dirty) | ||
| 43 | shutil.rmtree(self.tmpdir) | 39 | shutil.rmtree(self.tmpdir) |
