summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjvoisin2011-07-30 21:47:31 +0200
committerjvoisin2011-07-30 21:47:31 +0200
commit5715ba52f2238af513b0b87f4aa3c0158d2c84ba (patch)
treee77829efd78b1473650a669546c3c11edc37932c /test
parentc9cb00bdf702ce6663e78784de63dc6d35c3d875 (diff)
Documentation, and removal of unnecessary imports
Diffstat (limited to 'test')
-rw-r--r--test/clitest.py2
-rw-r--r--test/test.py22
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
8import sys 8import sys
9 9
10sys.path.append('..') 10sys.path.append('..')
11#import cli
12from lib import mat 11from lib import mat
13import test 12import 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
12import tempfile 12import tempfile
13import unittest 13import unittest
14 14
15sys.path.append('..')
16from lib import mat
17
18VERBOSITY = 3 15VERBOSITY = 3
19FILE_LIST = zip(glob.glob('clean*'), glob.glob('dirty*')) 16FILE_LIST = zip(glob.glob('clean*'), glob.glob('dirty*'))
20 17
21class MATTest(unittest.TestCase): 18class 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)