From 13e446aceb6ca774419f63d1028ee7b1bda71b30 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 18 Dec 2007 16:17:17 -0800 Subject: [PATCH] Update all tests to add the deferred as both errback and callback. --- apt_dht/AptPackages.py | 8 ++++---- apt_dht/HTTPDownloader.py | 4 ++-- apt_dht/MirrorManager.py | 2 +- apt_dht/PeerManager.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apt_dht/AptPackages.py b/apt_dht/AptPackages.py index 580849c..a605b2f 100644 --- a/apt_dht/AptPackages.py +++ b/apt_dht/AptPackages.py @@ -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): diff --git a/apt_dht/HTTPDownloader.py b/apt_dht/HTTPDownloader.py index 45ab4f7..cd3352f 100644 --- a/apt_dht/HTTPDownloader.py +++ b/apt_dht/HTTPDownloader.py @@ -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) diff --git a/apt_dht/MirrorManager.py b/apt_dht/MirrorManager.py index 67bb183..c2d8339 100644 --- a/apt_dht/MirrorManager.py +++ b/apt_dht/MirrorManager.py @@ -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): diff --git a/apt_dht/PeerManager.py b/apt_dht/PeerManager.py index 6a3b77d..115edad 100644 --- a/apt_dht/PeerManager.py +++ b/apt_dht/PeerManager.py @@ -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) -- 2.39.5