summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-10-23 23:02:55 +0200
committerMichał Górny <mgorny@gentoo.org>2017-10-23 23:02:55 +0200
commitfa4af74b282483ba1ba88b6b2e8ad2a39d81e737 (patch)
treec4718de3ab9342b5ce912e9a7559a775574e1c92 /tests
parentc45078cc8ee6f268dc3ec64ef42eb10f1e824623 (diff)
downloadgemato-fa4af74b282483ba1ba88b6b2e8ad2a39d81e737.tar.gz
verify: Support verifying against None (no entry)
Diffstat (limited to 'tests')
-rw-r--r--tests/test_verify.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/test_verify.py b/tests/test_verify.py
index e49e98a..5f3e492 100644
--- a/tests/test_verify.py
+++ b/tests/test_verify.py
@@ -39,6 +39,10 @@ class NonExistingFileVerificationTest(unittest.TestCase):
self.assertEqual(gemato.verify.verify_path(os.path.join(self.dir, e.path), e),
(True, []))
+ def testNone(self):
+ self.assertEqual(gemato.verify.verify_path(os.path.join(self.dir, 'test'), None),
+ (True, []))
+
class DirectoryVerificationTest(unittest.TestCase):
def setUp(self):
@@ -65,6 +69,10 @@ class DirectoryVerificationTest(unittest.TestCase):
self.assertEqual(gemato.verify.verify_path(self.dir, e),
(False, [('__exists__', False, True)]))
+ def testNone(self):
+ self.assertEqual(gemato.verify.verify_path(self.dir, None),
+ (False, [('__exists__', False, True)]))
+
class CharacterDeviceVerificationTest(unittest.TestCase):
def setUp(self):
@@ -88,6 +96,10 @@ class CharacterDeviceVerificationTest(unittest.TestCase):
self.assertEqual(gemato.verify.verify_path(self.path, e),
(False, [('__exists__', False, True)]))
+ def testNone(self):
+ self.assertEqual(gemato.verify.verify_path(self.path, None),
+ (False, [('__exists__', False, True)]))
+
class NamedPipeVerificationTest(unittest.TestCase):
def setUp(self):
@@ -117,6 +129,10 @@ class NamedPipeVerificationTest(unittest.TestCase):
self.assertEqual(gemato.verify.verify_path(self.path, e),
(False, [('__exists__', False, True)]))
+ def testNone(self):
+ self.assertEqual(gemato.verify.verify_path(self.path, None),
+ (False, [('__exists__', False, True)]))
+
class UNIXSocketVerificationTest(unittest.TestCase):
def setUp(self):
@@ -149,6 +165,10 @@ class UNIXSocketVerificationTest(unittest.TestCase):
self.assertEqual(gemato.verify.verify_path(self.path, e),
(False, [('__exists__', False, True)]))
+ def testNone(self):
+ self.assertEqual(gemato.verify.verify_path(self.path, None),
+ (False, [('__exists__', False, True)]))
+
class EmptyFileVerificationTest(unittest.TestCase):
def setUp(self):
@@ -217,6 +237,10 @@ class EmptyFileVerificationTest(unittest.TestCase):
self.assertEqual(gemato.verify.verify_path(self.path, e),
(False, [('__exists__', False, True)]))
+ def testNone(self):
+ self.assertEqual(gemato.verify.verify_path(self.path, None),
+ (False, [('__exists__', False, True)]))
+
class NonEmptyFileVerificationTest(unittest.TestCase):
def setUp(self):
@@ -286,6 +310,10 @@ class NonEmptyFileVerificationTest(unittest.TestCase):
self.assertEqual(gemato.verify.verify_path(self.path, e),
(False, [('__exists__', False, True)]))
+ def testNone(self):
+ self.assertEqual(gemato.verify.verify_path(self.path, None),
+ (False, [('__exists__', False, True)]))
+
class ProcFileVerificationTest(unittest.TestCase):
"""
@@ -370,6 +398,10 @@ class ProcFileVerificationTest(unittest.TestCase):
self.assertEqual(gemato.verify.verify_path(self.path, e),
(False, [('__exists__', False, True)]))
+ def testNone(self):
+ self.assertEqual(gemato.verify.verify_path(self.path, None),
+ (False, [('__exists__', False, True)]))
+
class ExceptionVerificationTest(object):
def setUp(self):
@@ -399,3 +431,7 @@ class ExceptionVerificationTest(object):
('DATA', os.path.basename(self.path), '0'))
self.assertRaises(gemato.verify.ManifestMismatch,
gemato.verify.assert_path_verifies, self.path, e)
+
+ def testNone(self):
+ self.assertRaises(gemato.verify.ManifestMismatch,
+ gemato.verify.gemato.verify.assert_path_verifies, self.path, None)