From d2d343c71067b7ffc92ea47c84f98cc5684cf413 Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Fri, 8 Jun 2018 12:49:49 -0400 Subject: [PATCH] Remove usage from the local `TestCase` --- src/allmydata/test/test_node.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/allmydata/test/test_node.py b/src/allmydata/test/test_node.py index 93d38e5ca..4581a4549 100644 --- a/src/allmydata/test/test_node.py +++ b/src/allmydata/test/test_node.py @@ -36,12 +36,14 @@ class TestNode(Node): class TestCase(testutil.SignalMixin, unittest.TestCase): - @defer.inlineCallbacks def setUp(self): testutil.SignalMixin.setUp(self) self.parent = LoggingMultiService() self.parent.startService() - self._available_port = yield iputil.allocate_tcp_port() + # We can use a made-up port number because these tests never actually + # try to bind the port. We'll use a low-numbered one that's likely to + # conflict with another service to prove it. + self._available_port = 22 def tearDown(self): log.msg("%s.tearDown" % self.__class__.__name__) @@ -66,10 +68,9 @@ class TestCase(testutil.SignalMixin, unittest.TestCase): lambda: local_addresses) n = TestNode(basedir) - n.setServiceParent(self.parent) furl = n.tub.registerReference(n) for address in expected_addresses: - self.failUnlessIn(address, furl) + self.assertIn(address, furl) def test_location1(self): return self._test_location(basedir="test_node/test_location1",