summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2015-11-15 16:29:38 +0100
committerjvoisin2015-11-15 16:29:38 +0100
commitb7755bbf4d70e80d1d0cc027f4ac7ffcf6c062de (patch)
tree09239e768f5208c6753aa632f7c72a67ff85721d
parentb285d72105815a6858f3df3db15cc83329041310 (diff)
Add forgotten tests for the command-line
Thanks to Rafiot for the heads up
-rw-r--r--test/clitest.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/clitest.py b/test/clitest.py
index c913bdf..8d48624 100644
--- a/test/clitest.py
+++ b/test/clitest.py
@@ -98,20 +98,20 @@ class TestFileAttributes(unittest.TestCase):
98 proc = subprocess.Popen([MAT_PATH, 'not_writtable'], 98 proc = subprocess.Popen([MAT_PATH, 'not_writtable'],
99 stdout=subprocess.PIPE) 99 stdout=subprocess.PIPE)
100 stdout, _ = proc.communicate() 100 stdout, _ = proc.communicate()
101 self.assertEqual(str(stdout).strip('\n'), '[-] %s is not writable' % 'not_writtable') 101 self.assertEqual(str(stdout).strip('\n'), '[-] Unable to process not_writtable')
102 102
103 def test_not_exist(self): 103 def test_not_exist(self):
104 """ test MAT's behaviour on non-existent file""" 104 """ test MAT's behaviour on non-existent file"""
105 proc = subprocess.Popen([MAT_PATH, 'ilikecookies'], 105 proc = subprocess.Popen([MAT_PATH, 'ilikecookies'],
106 stdout=subprocess.PIPE) 106 stdout=subprocess.PIPE)
107 stdout, _ = proc.communicate() 107 stdout, _ = proc.communicate()
108 self.assertEqual(str(stdout).strip('\n'), 'Unable to process %s' % 'ilikecookies') 108 self.assertEqual(str(stdout).strip('\n'), '[-] Unable to process ilikecookies')
109 109
110 def test_empty(self): 110 def test_empty(self):
111 """ test MAT's behaviour on empty file""" 111 """ test MAT's behaviour on empty file"""
112 proc = subprocess.Popen([MAT_PATH, 'empty_file'], stdout=subprocess.PIPE) 112 proc = subprocess.Popen([MAT_PATH, 'empty_file'], stdout=subprocess.PIPE)
113 stdout, _ = proc.communicate() 113 stdout, _ = proc.communicate()
114 self.assertEqual(str(stdout).strip('\n'), 'Unable to process %s' % 'ilikecookies') 114 self.assertEqual(str(stdout).strip('\n'), '[-] Unable to process empty_file')
115 115
116 116
117class TestUnsupported(test.MATTest): 117class TestUnsupported(test.MATTest):
@@ -137,4 +137,5 @@ def get_tests():
137 suite.addTest(unittest.makeSuite(TestListcli)) 137 suite.addTest(unittest.makeSuite(TestListcli))
138 suite.addTest(unittest.makeSuite(TestisCleancli)) 138 suite.addTest(unittest.makeSuite(TestisCleancli))
139 suite.addTest(unittest.makeSuite(TestUnsupported)) 139 suite.addTest(unittest.makeSuite(TestUnsupported))
140 suite.addTest(unittest.makeSuite(TestFileAttributes))
140 return suite 141 return suite