]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
checker: improve test coverage a little bit
authorBrian Warner <warner@allmydata.com>
Wed, 5 Dec 2007 01:00:12 +0000 (18:00 -0700)
committerBrian Warner <warner@allmydata.com>
Wed, 5 Dec 2007 01:00:12 +0000 (18:00 -0700)
src/allmydata/checker.py
src/allmydata/test/test_system.py

index fdb8d3121f5fd7208d0672f502a9b4f33b8b38bb..66874013734ddc5a83ae72656b0dcd19c99364c3 100644 (file)
@@ -223,10 +223,10 @@ class Checker(service.MultiService):
         return d
 
     def verify(self, uri_to_verify):
-        uri_to_verify = IVerifierURI(uri_to_verify)
         if uri_to_verify is None:
             return defer.succeed(True)
-        elif isinstance(uri_to_verify, uri.CHKFileVerifierURI):
+        uri_to_verify = IVerifierURI(uri_to_verify)
+        if isinstance(uri_to_verify, uri.CHKFileVerifierURI):
             v = SimpleCHKFileVerifier(self.parent, uri_to_verify)
             return v.start()
         else:
index 9711991406c82c62f11d50393b689424042757a1..e72d8392ef9fdeed456c4b575dfed44856089e4d 100644 (file)
@@ -1164,6 +1164,9 @@ class SystemTest(testutil.SignalMixin, unittest.TestCase):
 
     def _test_checker_2(self, manifest):
         checker1 = self.clients[1].getServiceNamed("checker")
+        self.failUnlessEqual(checker1.checker_results_for(None), [])
+        self.failUnlessEqual(checker1.checker_results_for(list(manifest)[0]),
+                             [])
         dl = []
         starting_time = time.time()
         for si in manifest:
@@ -1245,4 +1248,6 @@ class SystemTest(testutil.SignalMixin, unittest.TestCase):
             for i in res:
                 self.failUnless(i is True)
         d.addCallback(_done)
+        d.addCallback(lambda res: checker1.verify(None))
+        d.addCallback(self.failUnlessEqual, True)
         return d