diff options
| author | jvoisin | 2015-12-03 14:42:21 +0100 |
|---|---|---|
| committer | jvoisin | 2015-12-03 14:42:21 +0100 |
| commit | 70ef290a5db26309bc9112e6007bee77331ddebe (patch) | |
| tree | ca29ac89cf531729428851c827e5cb26974e4da9 /test/clitest.py | |
| parent | 0d3ef2edd7accd04e0b7e39bbf303362b8e8e1c2 (diff) | |
Add some file-attribute related tests
Diffstat (limited to 'test/clitest.py')
| -rw-r--r-- | test/clitest.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/clitest.py b/test/clitest.py index ec3c19c..3b09c62 100644 --- a/test/clitest.py +++ b/test/clitest.py | |||
| @@ -10,6 +10,7 @@ import unittest | |||
| 10 | import subprocess | 10 | import subprocess |
| 11 | import sys | 11 | import sys |
| 12 | import tarfile | 12 | import tarfile |
| 13 | import stat | ||
| 13 | 14 | ||
| 14 | import test | 15 | import test |
| 15 | MAT_PATH = 'mat' | 16 | MAT_PATH = 'mat' |
| @@ -113,6 +114,14 @@ class TestFileAttributes(unittest.TestCase): | |||
| 113 | stdout, _ = proc.communicate() | 114 | stdout, _ = proc.communicate() |
| 114 | self.assertEqual(str(stdout).strip('\n'), '[-] Unable to process empty_file') | 115 | self.assertEqual(str(stdout).strip('\n'), '[-] Unable to process empty_file') |
| 115 | 116 | ||
| 117 | def test_not_readable(self): | ||
| 118 | """ test MAT's behaviour on non-writable file""" | ||
| 119 | open('non_readable', 'a').close() | ||
| 120 | os.chmod('non_readable', 0 & stat.S_IWRITE) | ||
| 121 | proc = subprocess.Popen([MAT_PATH, 'non_readable'], stdout=subprocess.PIPE) | ||
| 122 | stdout, _ = proc.communicate() | ||
| 123 | os.remove('non_readable') | ||
| 124 | |||
| 116 | 125 | ||
| 117 | class TestUnsupported(test.MATTest): | 126 | class TestUnsupported(test.MATTest): |
| 118 | """ test MAT's behaviour on unsupported files """ | 127 | """ test MAT's behaviour on unsupported files """ |
