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 | |
| parent | c9cb00bdf702ce6663e78784de63dc6d35c3d875 (diff) | |
Documentation, and removal of unnecessary imports
Diffstat (limited to 'test')
| -rw-r--r-- | test/clitest.py | 2 | ||||
| -rw-r--r-- | test/test.py | 22 |
2 files changed, 9 insertions, 15 deletions
diff --git a/test/clitest.py b/test/clitest.py index f71a622..453333a 100644 --- a/test/clitest.py +++ b/test/clitest.py | |||
| @@ -8,7 +8,6 @@ import subprocess | |||
| 8 | import sys | 8 | import sys |
| 9 | 9 | ||
| 10 | sys.path.append('..') | 10 | sys.path.append('..') |
| 11 | #import cli | ||
| 12 | from lib import mat | 11 | from lib import mat |
| 13 | import test | 12 | import test |
| 14 | 13 | ||
| @@ -57,7 +56,6 @@ class TestisCleancli(test.MATTest): | |||
| 57 | ''' | 56 | ''' |
| 58 | check if cli.py correctly check if a file is clean or not | 57 | check if cli.py correctly check if a file is clean or not |
| 59 | ''' | 58 | ''' |
| 60 | #FIXME : use an external file with string as const ? | ||
| 61 | def test_clean(self): | 59 | def test_clean(self): |
| 62 | '''test is_clean on clean files''' | 60 | '''test is_clean on clean files''' |
| 63 | for clean, _ in self.file_list: | 61 | for clean, _ in self.file_list: |
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) |
