summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gemato/verify.py11
-rw-r--r--tests/test_verify.py36
2 files changed, 1 insertions, 46 deletions
diff --git a/gemato/verify.py b/gemato/verify.py
index 74791ee..a4d336b 100644
--- a/gemato/verify.py
+++ b/gemato/verify.py
@@ -176,14 +176,3 @@ def verify_entry_compatibility(e1, e2):
ret = False
return (ret, diff)
-
-
-def assert_path_verifies(path, e, expected_dev=None):
- """
- Verify the path @path against entry @e. Raises an exception if it
- does not pass the verification.
- """
-
- ret, diff = verify_path(path, e, expected_dev=expected_dev)
- if not ret:
- raise gemato.exceptions.ManifestMismatch(path, e, diff)
diff --git a/tests/test_verify.py b/tests/test_verify.py
index bc41532..2b656a8 100644
--- a/tests/test_verify.py
+++ b/tests/test_verify.py
@@ -262,7 +262,7 @@ class EmptyFileVerificationTest(unittest.TestCase):
e = gemato.manifest.ManifestEntryDATA.from_list(
('DATA', os.path.basename(self.path), '0'))
self.assertRaises(gemato.exceptions.ManifestCrossDevice,
- gemato.verify.assert_path_verifies, self.path, e,
+ gemato.verify.verify_path, self.path, e,
expected_dev=st.st_dev)
@@ -495,40 +495,6 @@ class UnreadableFileVerificationTest(unittest.TestCase):
os.path.join(self.dir, e.path), e)
-class ExceptionVerificationTest(object):
- def setUp(self):
- TEST_STRING = b'The quick brown fox jumps over the lazy dog'
- self.f = tempfile.NamedTemporaryFile()
- self.f.write(TEST_STRING)
- self.f.flush()
- self.path = self.f.name
-
- def tearDown(self):
- self.f.close()
-
- def testDATA(self):
- e = gemato.manifest.ManifestEntryDATA.from_list(
- ('DATA', os.path.basename(self.path), '43'))
- gemato.verify.assert_path_verifies(self.path, e)
-
- def testChecksumDATA(self):
- e = gemato.manifest.ManifestEntryDATA.from_list(
- ('DATA', os.path.basename(self.path), '43',
- 'MD5', '9e107d9d372bb6826bd81d3542a419d6',
- 'SHA1', '2fd4e1c67a2d28fced849ee1bb76e7391b93eb12'))
- gemato.verify.assert_path_verifies(self.path, e)
-
- def testWrongSizeDATA(self):
- e = gemato.manifest.ManifestEntryDATA.from_list(
- ('DATA', os.path.basename(self.path), '0'))
- self.assertRaises(gemato.exceptions.ManifestMismatch,
- gemato.verify.assert_path_verifies, self.path, e)
-
- def testNone(self):
- self.assertRaises(gemato.exceptions.ManifestMismatch,
- gemato.verify.gemato.verify.assert_path_verifies, self.path, None)
-
-
class EntryCompatibilityVerificationTest(unittest.TestCase):
def test_matching_entry(self):
e1 = gemato.manifest.ManifestEntryDATA.from_list(