From 0425c95b681d6d09c1eb72e0ef433f6f8bde8d44 Mon Sep 17 00:00:00 2001 From: Kay Kurokawa Date: Thu, 9 Nov 2017 14:47:55 -0500 Subject: [PATCH] No need for clock now in test for DHTHashAnnouncer --- lbrynet/tests/unit/core/server/test_DHTHashAnnouncer.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lbrynet/tests/unit/core/server/test_DHTHashAnnouncer.py b/lbrynet/tests/unit/core/server/test_DHTHashAnnouncer.py index e2c7aee9c..1f5b502ab 100644 --- a/lbrynet/tests/unit/core/server/test_DHTHashAnnouncer.py +++ b/lbrynet/tests/unit/core/server/test_DHTHashAnnouncer.py @@ -1,7 +1,6 @@ from twisted.trial import unittest -from twisted.internet import defer, task, reactor +from twisted.internet import defer, reactor -from lbrynet.core import utils from lbrynet.tests.util import random_lbry_hash from lbrynet.core.server.DHTHashAnnouncer import DHTHashAnnouncer @@ -41,9 +40,7 @@ class DHTHashAnnouncerTest(unittest.TestCase): self.blobs_to_announce = [] for i in range(0, self.num_blobs): self.blobs_to_announce.append(random_lbry_hash()) - self.clock = task.Clock() self.dht_node = MocDHTNode() - utils.call_later = self.clock.callLater self.announcer = DHTHashAnnouncer(self.dht_node, peer_port=3333) self.supplier = MocSupplier(self.blobs_to_announce) self.announcer.add_supplier(self.supplier) @@ -52,7 +49,6 @@ class DHTHashAnnouncerTest(unittest.TestCase): def test_basic(self): d = self.announcer._announce_available_hashes() self.assertEqual(self.announcer.hash_queue_size(), self.announcer.CONCURRENT_ANNOUNCERS) - self.clock.advance(1) yield d self.assertEqual(self.dht_node.blobs_announced, self.num_blobs) self.assertEqual(self.announcer.hash_queue_size(), 0)