summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2011-08-19 16:53:40 +0200
committerjvoisin2011-08-19 16:53:40 +0200
commit11c09cfab5472cce3e97a3bc4c69fc87f24b4490 (patch)
tree02266d82b5a71976b6ddd45717ec7ed5ce81fe0e
parent10f56905e9166de3c5f6aad8d8305e2b122205a5 (diff)
Correct the testsuite according to the renaming of cli.py
-rw-r--r--test/clitest.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/clitest.py b/test/clitest.py
index c2d11af..ebb4ebc 100644
--- a/test/clitest.py
+++ b/test/clitest.py
@@ -13,31 +13,31 @@ import test
13 13
14class TestRemovecli(test.MATTest): 14class TestRemovecli(test.MATTest):
15 ''' 15 '''
16 test if cli.py correctly remove metadatas 16 test if cli correctly remove metadatas
17 ''' 17 '''
18 def test_remove(self): 18 def test_remove(self):
19 '''make sure that the cli remove all compromizing meta''' 19 '''make sure that the cli remove all compromizing meta'''
20 for _, dirty in self.file_list: 20 for _, dirty in self.file_list:
21 subprocess.call(['../mat-cli.py', dirty]) 21 subprocess.call(['../mat-cli', dirty])
22 current_file = mat.create_class_file(dirty, False, True) 22 current_file = mat.create_class_file(dirty, False, True)
23 self.assertTrue(current_file.is_clean()) 23 self.assertTrue(current_file.is_clean())
24 24
25 def test_remove_empty(self): 25 def test_remove_empty(self):
26 '''Test removal with clean files''' 26 '''Test removal with clean files'''
27 for clean, _ in self.file_list: 27 for clean, _ in self.file_list:
28 subprocess.call(['../mat-cli.py', clean]) 28 subprocess.call(['../mat-cli', clean])
29 current_file = mat.create_class_file(clean, False, True) 29 current_file = mat.create_class_file(clean, False, True)
30 self.assertTrue(current_file.is_clean()) 30 self.assertTrue(current_file.is_clean())
31 31
32 32
33class TestListcli(test.MATTest): 33class TestListcli(test.MATTest):
34 ''' 34 '''
35 test if cli.py correctly display metadatas 35 test if cli correctly display metadatas
36 ''' 36 '''
37 def test_list_clean(self): 37 def test_list_clean(self):
38 '''check if get_meta returns meta''' 38 '''check if get_meta returns meta'''
39 for clean, _ in self.file_list: 39 for clean, _ in self.file_list:
40 proc = subprocess.Popen(['../mat-cli.py', '-d', clean], 40 proc = subprocess.Popen(['../mat-cli', '-d', clean],
41 stdout=subprocess.PIPE) 41 stdout=subprocess.PIPE)
42 stdout, _ = proc.communicate() 42 stdout, _ = proc.communicate()
43 self.assertEqual(stdout.strip('\n'), "[+] File %s :\nNo harmful \ 43 self.assertEqual(stdout.strip('\n'), "[+] File %s :\nNo harmful \
@@ -46,7 +46,7 @@ meta found" % clean)
46 def test_list_dirty(self): 46 def test_list_dirty(self):
47 '''check if get_meta returns all the expected meta''' 47 '''check if get_meta returns all the expected meta'''
48 for _, dirty in self.file_list: 48 for _, dirty in self.file_list:
49 proc = subprocess.Popen(['../mat-cli.py', '-d', dirty], 49 proc = subprocess.Popen(['../mat-cli', '-d', dirty],
50 stdout=subprocess.PIPE) 50 stdout=subprocess.PIPE)
51 stdout, _ = proc.communicate() 51 stdout, _ = proc.communicate()
52 self.assertNotEqual(stdout, "[+] File %s" % dirty) 52 self.assertNotEqual(stdout, "[+] File %s" % dirty)
@@ -54,12 +54,12 @@ meta found" % clean)
54 54
55class TestisCleancli(test.MATTest): 55class TestisCleancli(test.MATTest):
56 ''' 56 '''
57 check if cli.py correctly check if a file is clean or not 57 check if cli correctly check if a file is clean or not
58 ''' 58 '''
59 def test_clean(self): 59 def test_clean(self):
60 '''test is_clean on clean files''' 60 '''test is_clean on clean files'''
61 for clean, _ in self.file_list: 61 for clean, _ in self.file_list:
62 proc = subprocess.Popen(['../mat-cli.py', '-c', clean], 62 proc = subprocess.Popen(['../mat-cli', '-c', clean],
63 stdout=subprocess.PIPE) 63 stdout=subprocess.PIPE)
64 stdout, _ = proc.communicate() 64 stdout, _ = proc.communicate()
65 self.assertEqual(stdout.strip('\n'), '[+] %s is clean' % clean) 65 self.assertEqual(stdout.strip('\n'), '[+] %s is clean' % clean)
@@ -67,7 +67,7 @@ class TestisCleancli(test.MATTest):
67 def test_dirty(self): 67 def test_dirty(self):
68 '''test is_clean on dirty files''' 68 '''test is_clean on dirty files'''
69 for _, dirty in self.file_list: 69 for _, dirty in self.file_list:
70 proc = subprocess.Popen(['../mat-cli.py', '-c', dirty], 70 proc = subprocess.Popen(['../mat-cli', '-c', dirty],
71 stdout=subprocess.PIPE) 71 stdout=subprocess.PIPE)
72 stdout, _ = proc.communicate() 72 stdout, _ = proc.communicate()
73 self.assertEqual(stdout.strip('\n'), '[+] %s is not clean' % dirty) 73 self.assertEqual(stdout.strip('\n'), '[+] %s is not clean' % dirty)