diff options
Diffstat (limited to 'test/clitest.py')
| -rw-r--r-- | test/clitest.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/clitest.py b/test/clitest.py index cb615ce..db54843 100644 --- a/test/clitest.py +++ b/test/clitest.py | |||
| @@ -72,6 +72,27 @@ class TestisCleancli(test.MATTest): | |||
| 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) |
| 74 | 74 | ||
| 75 | class TestFileAttributes(unittest.TestCase): | ||
| 76 | ''' | ||
| 77 | test various stuffs about files (readable, writable, exist, ...) | ||
| 78 | ''' | ||
| 79 | def test_not_readable(self): | ||
| 80 | proc = subprocess.Popen(['../mat-cli', 'not_readable'], | ||
| 81 | stdout=subprocess.PIPE) | ||
| 82 | stdout, _ = proc.communicate() | ||
| 83 | self.assertEqual(stdout.strip('\n'), 'Unable to pocess %s' % 'not_readable') | ||
| 84 | |||
| 85 | def test_not_writtable(self): | ||
| 86 | proc = subprocess.Popen(['../mat-cli', 'not_writtable'], | ||
| 87 | stdout=subprocess.PIPE) | ||
| 88 | stdout, _ = proc.communicate() | ||
| 89 | self.assertEqual(stdout.strip('\n'), 'Unable to pocess %s' % 'not_writtable') | ||
| 90 | |||
| 91 | def test_not_exist(self): | ||
| 92 | proc = subprocess.Popen(['../mat-cli', 'ilikecookies'], | ||
| 93 | stdout=subprocess.PIPE) | ||
| 94 | stdout, _ = proc.communicate() | ||
| 95 | self.assertEqual(stdout.strip('\n'), 'Unable to pocess %s' % 'ilikecookies') | ||
| 75 | 96 | ||
| 76 | if __name__ == '__main__': | 97 | if __name__ == '__main__': |
| 77 | suite = unittest.TestSuite() | 98 | suite = unittest.TestSuite() |
