]> git.mxchange.org Git - quix0rs-apt-p2p.git/commitdiff
Update all tests to add the deferred as both errback and callback.
authorCameron <camrdale@stevepad.(none)>
Wed, 19 Dec 2007 00:17:17 +0000 (16:17 -0800)
committerCameron <camrdale@stevepad.(none)>
Wed, 19 Dec 2007 00:17:17 +0000 (16:17 -0800)
apt_dht/AptPackages.py
apt_dht/HTTPDownloader.py
apt_dht/MirrorManager.py
apt_dht/PeerManager.py

index 580849cc7db386b716c69f94246d81f6f862d3e4..a605b2ff58c0993cb7b872a76bae3d73c611072b 100644 (file)
@@ -402,7 +402,7 @@ class TestAptPackages(unittest.TestCase):
         d = self.client.findHash(idx_path)
         d.addCallback(self.verifyHash, idx_path, idx_hash)
 
-        d.addCallback(lastDefer.callback)
+        d.addBoth(lastDefer.callback)
         return lastDefer
 
     def test_findPkgHash(self):
@@ -420,7 +420,7 @@ class TestAptPackages(unittest.TestCase):
         d = self.client.findHash(pkg_path)
         d.addCallback(self.verifyHash, pkg_path, pkg_hash)
 
-        d.addCallback(lastDefer.callback)
+        d.addBoth(lastDefer.callback)
         return lastDefer
 
     def test_findSrcHash(self):
@@ -443,7 +443,7 @@ class TestAptPackages(unittest.TestCase):
         d = self.client.findHash(src_dir + '/' + src_paths[i])
         d.addCallback(self.verifyHash, src_dir + '/' + src_paths[i], src_hashes[i])
             
-        d.addCallback(lastDefer.callback)
+        d.addBoth(lastDefer.callback)
         return lastDefer
 
     def test_multipleFindHash(self):
@@ -496,7 +496,7 @@ class TestAptPackages(unittest.TestCase):
         d = self.client.findHash(idx_path)
         d.addCallback(self.verifyHash, idx_path, idx_hash)
 
-        d.addCallback(lastDefer.callback)
+        d.addBoth(lastDefer.callback)
         return lastDefer
 
     def tearDown(self):
index 45ab4f790efaaf61fcb91030c9211a19c08eaf20..cd3352f04b672db963ed27145b64ba79e5dc163a 100644 (file)
@@ -171,7 +171,7 @@ class TestClientManager(unittest.TestCase):
             d = self.client.get(path)
             d.addCallback(self.gotResp, num, expect)
             if last:
-                d.addCallback(lastDefer.callback)
+                d.addBoth(lastDefer.callback)
                 
         newRequest("/", 1, 3433)
         newRequest("/blog/", 2, 37121)
@@ -195,7 +195,7 @@ class TestClientManager(unittest.TestCase):
             d = self.client.get(path)
             d.addCallback(self.gotResp, num, expect)
             if last:
-                d.addCallback(lastDefer.callback)
+                d.addBoth(lastDefer.callback)
                 
         newRequest("/", 1, 3433)
         newRequest("/blog/", 2, 37121)
index 67bb183acadd0b130c9890eb45f4a90c1bb02614..c2d83398e0893dfd6e37e003510f7f40a0d3b58e 100644 (file)
@@ -163,7 +163,7 @@ class TestMirrorManager(unittest.TestCase):
         d = self.client.findHash(idx_path)
         d.addCallback(self.verifyHash, idx_path, idx_hash)
 
-        d.addCallback(lastDefer.callback)
+        d.addBoth(lastDefer.callback)
         return lastDefer
 
     def tearDown(self):
index 6a3b77dd4e56df366941dcf2f4c5e6bd6d1944a3..115edad8cc694931691b33b618a3f6baf1148bd7 100644 (file)
@@ -76,7 +76,7 @@ class TestPeerManager(unittest.TestCase):
             d = self.manager.get([(host, 80, path)])
             d.addCallback(self.gotResp, num, expect)
             if last:
-                d.addCallback(lastDefer.callback)
+                d.addBoth(lastDefer.callback)
                 
         newRequest('www.camrdale.org', "/", 1, 3433)
         newRequest('www.camrdale.org', "/blog/", 2, 37121)