summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorjvoisin2012-02-01 22:56:04 +0100
committerjvoisin2012-02-01 22:56:04 +0100
commit544fe9bf1782a027b3f31bf4c10a050d783e32ac (patch)
treea8dd60b9ae45efea4875fdb827070531f0199717 /test
parent9ea6dc6960cebfa70d18ba8ee49d775ea91c9b34 (diff)
Rename mat-cli to mat-gui
Diffstat (limited to 'test')
-rw-r--r--test/clitest.py20
-rw-r--r--test/libtest.py2
2 files changed, 11 insertions, 11 deletions
diff --git a/test/clitest.py b/test/clitest.py
index 9232745..5b0f0c3 100644
--- a/test/clitest.py
+++ b/test/clitest.py
@@ -8,7 +8,7 @@ import subprocess
8import sys 8import sys
9 9
10sys.path.append('..') 10sys.path.append('..')
11from mat import mat 11from lib import mat
12import test 12import test
13 13
14 14
@@ -19,14 +19,14 @@ class TestRemovecli(test.MATTest):
19 def test_remove(self): 19 def test_remove(self):
20 '''make sure that the cli remove all compromizing meta''' 20 '''make sure that the cli remove all compromizing meta'''
21 for _, dirty in self.file_list: 21 for _, dirty in self.file_list:
22 subprocess.call(['../mat-cli', dirty]) 22 subprocess.call(['../mat', dirty])
23 current_file = mat.create_class_file(dirty, False, True) 23 current_file = mat.create_class_file(dirty, False, True)
24 self.assertTrue(current_file.is_clean()) 24 self.assertTrue(current_file.is_clean())
25 25
26 def test_remove_empty(self): 26 def test_remove_empty(self):
27 '''Test removal with clean files''' 27 '''Test removal with clean files'''
28 for clean, _ in self.file_list: 28 for clean, _ in self.file_list:
29 subprocess.call(['../mat-cli', clean]) 29 subprocess.call(['../mat', clean])
30 current_file = mat.create_class_file(clean, False, True) 30 current_file = mat.create_class_file(clean, False, True)
31 self.assertTrue(current_file.is_clean()) 31 self.assertTrue(current_file.is_clean())
32 32
@@ -38,7 +38,7 @@ class TestListcli(test.MATTest):
38 def test_list_clean(self): 38 def test_list_clean(self):
39 '''check if get_meta returns meta''' 39 '''check if get_meta returns meta'''
40 for clean, _ in self.file_list: 40 for clean, _ in self.file_list:
41 proc = subprocess.Popen(['../mat-cli', '-d', clean], 41 proc = subprocess.Popen(['../mat', '-d', clean],
42 stdout=subprocess.PIPE) 42 stdout=subprocess.PIPE)
43 stdout, _ = proc.communicate() 43 stdout, _ = proc.communicate()
44 self.assertEqual(stdout.strip('\n'), "[+] File %s :\nNo harmful \ 44 self.assertEqual(stdout.strip('\n'), "[+] File %s :\nNo harmful \
@@ -47,7 +47,7 @@ metadata found" % clean)
47 def test_list_dirty(self): 47 def test_list_dirty(self):
48 '''check if get_meta returns all the expected meta''' 48 '''check if get_meta returns all the expected meta'''
49 for _, dirty in self.file_list: 49 for _, dirty in self.file_list:
50 proc = subprocess.Popen(['../mat-cli', '-d', dirty], 50 proc = subprocess.Popen(['../mat', '-d', dirty],
51 stdout=subprocess.PIPE) 51 stdout=subprocess.PIPE)
52 stdout, _ = proc.communicate() 52 stdout, _ = proc.communicate()
53 self.assertNotEqual(stdout, "[+] File %s" % dirty) 53 self.assertNotEqual(stdout, "[+] File %s" % dirty)
@@ -60,7 +60,7 @@ class TestisCleancli(test.MATTest):
60 def test_clean(self): 60 def test_clean(self):
61 '''test is_clean on clean files''' 61 '''test is_clean on clean files'''
62 for clean, _ in self.file_list: 62 for clean, _ in self.file_list:
63 proc = subprocess.Popen(['../mat-cli', '-c', clean], 63 proc = subprocess.Popen(['../mat', '-c', clean],
64 stdout=subprocess.PIPE) 64 stdout=subprocess.PIPE)
65 stdout, _ = proc.communicate() 65 stdout, _ = proc.communicate()
66 self.assertEqual(stdout.strip('\n'), '[+] %s is clean' % clean) 66 self.assertEqual(stdout.strip('\n'), '[+] %s is clean' % clean)
@@ -68,7 +68,7 @@ class TestisCleancli(test.MATTest):
68 def test_dirty(self): 68 def test_dirty(self):
69 '''test is_clean on dirty files''' 69 '''test is_clean on dirty files'''
70 for _, dirty in self.file_list: 70 for _, dirty in self.file_list:
71 proc = subprocess.Popen(['../mat-cli', '-c', dirty], 71 proc = subprocess.Popen(['../mat', '-c', dirty],
72 stdout=subprocess.PIPE) 72 stdout=subprocess.PIPE)
73 stdout, _ = proc.communicate() 73 stdout, _ = proc.communicate()
74 self.assertEqual(stdout.strip('\n'), '[+] %s is not clean' % dirty) 74 self.assertEqual(stdout.strip('\n'), '[+] %s is not clean' % dirty)
@@ -79,19 +79,19 @@ class TestFileAttributes(unittest.TestCase):
79 test various stuffs about files (readable, writable, exist, ...) 79 test various stuffs about files (readable, writable, exist, ...)
80 ''' 80 '''
81 def test_not_readable(self): 81 def test_not_readable(self):
82 proc = subprocess.Popen(['../mat-cli', 'not_readable'], 82 proc = subprocess.Popen(['../mat', 'not_readable'],
83 stdout=subprocess.PIPE) 83 stdout=subprocess.PIPE)
84 stdout, _ = proc.communicate() 84 stdout, _ = proc.communicate()
85 self.assertEqual(stdout.strip('\n'), 'Unable to pocess %s' % 'not_readable') 85 self.assertEqual(stdout.strip('\n'), 'Unable to pocess %s' % 'not_readable')
86 86
87 def test_not_writtable(self): 87 def test_not_writtable(self):
88 proc = subprocess.Popen(['../mat-cli', 'not_writtable'], 88 proc = subprocess.Popen(['../mat', 'not_writtable'],
89 stdout=subprocess.PIPE) 89 stdout=subprocess.PIPE)
90 stdout, _ = proc.communicate() 90 stdout, _ = proc.communicate()
91 self.assertEqual(stdout.strip('\n'), 'Unable to pocess %s' % 'not_writtable') 91 self.assertEqual(stdout.strip('\n'), 'Unable to pocess %s' % 'not_writtable')
92 92
93 def test_not_exist(self): 93 def test_not_exist(self):
94 proc = subprocess.Popen(['../mat-cli', 'ilikecookies'], 94 proc = subprocess.Popen(['../mat', 'ilikecookies'],
95 stdout=subprocess.PIPE) 95 stdout=subprocess.PIPE)
96 stdout, _ = proc.communicate() 96 stdout, _ = proc.communicate()
97 self.assertEqual(stdout.strip('\n'), 'Unable to pocess %s' % 'ilikecookies') 97 self.assertEqual(stdout.strip('\n'), 'Unable to pocess %s' % 'ilikecookies')
diff --git a/test/libtest.py b/test/libtest.py
index 6217b69..9ac12c0 100644
--- a/test/libtest.py
+++ b/test/libtest.py
@@ -8,7 +8,7 @@ import unittest
8import test 8import test
9import sys 9import sys
10sys.path.append('..') 10sys.path.append('..')
11from mat import mat 11from lib import mat
12 12
13 13
14class TestRemovelib(test.MATTest): 14class TestRemovelib(test.MATTest):