diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-11-02 13:06:19 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-11-02 13:06:19 +0100 |
commit | aeb42b5b74b4a92d63a201b5f1306cfcd42ed3ae (patch) | |
tree | 0ca30a8ba8c7bb08eb12ce79d71448416ea03e28 /tests/test_verify.py | |
parent | 1bfd421467e46ddd6952dac2f5ef4f639bd65824 (diff) | |
download | gemato-aeb42b5b74b4a92d63a201b5f1306cfcd42ed3ae.tar.gz |
test_verify: Add mtime test for entry=None
Diffstat (limited to 'tests/test_verify.py')
-rw-r--r-- | tests/test_verify.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_verify.py b/tests/test_verify.py index 93360b9..a32ea8d 100644 --- a/tests/test_verify.py +++ b/tests/test_verify.py @@ -492,6 +492,16 @@ class EmptyFileVerificationTest(unittest.TestCase): 'SHA1': 'da39a3ee5e6b4b0d3255bfef95601890afd80709', }) + def test_None_with_mtime(self): + """ + Test that mtime does not cause stray files to go unnoticed. + """ + st = os.stat(self.path) + self.assertEqual( + gemato.verify.verify_path(self.path, None, + last_mtime=st.st_mtime), + (False, [('__exists__', False, True)])) + class NonEmptyFileVerificationTest(unittest.TestCase): def setUp(self): @@ -704,6 +714,16 @@ class NonEmptyFileVerificationTest(unittest.TestCase): 'SHA1': '2fd4e1c67a2d28fced849ee1bb76e7391b93eb12', }) + def test_None_with_mtime(self): + """ + Test that mtime does not cause stray files to go unnoticed. + """ + st = os.stat(self.path) + self.assertEqual( + gemato.verify.verify_path(self.path, None, + last_mtime=st.st_mtime), + (False, [('__exists__', False, True)])) + class SymbolicLinkVerificationTest(NonEmptyFileVerificationTest): """ |