From aeb42b5b74b4a92d63a201b5f1306cfcd42ed3ae Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Thu, 2 Nov 2017 13:06:19 +0100 Subject: test_verify: Add mtime test for entry=None --- tests/test_verify.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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): """ -- cgit v1.2.3