From: Daira Hopwood Date: Tue, 25 Jun 2013 18:50:00 +0000 (+0100) Subject: test_iputil.py: repair a test by mocking 'get_local_ip_for'. X-Git-Tag: allmydata-tahoe-1.10.1a1~232 X-Git-Url: https://git.rkrishnan.org/pf/statistics?a=commitdiff_plain;h=b31a4f6e870cb56efa40c785a868a944b964e8b9;p=tahoe-lafs%2Ftahoe-lafs.git test_iputil.py: repair a test by mocking 'get_local_ip_for'. Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/test/test_iputil.py b/src/allmydata/test/test_iputil.py index b56b8d23..fcb10178 100644 --- a/src/allmydata/test/test_iputil.py +++ b/src/allmydata/test/test_iputil.py @@ -104,9 +104,13 @@ class ListAddresses(testutil.SignalMixin, unittest.TestCase): raise e self.patch(subprocess, 'Popen', call_Popen) + def call_get_local_ip_for(target): + return "192.168.0.10" + self.patch(iputil, 'get_local_ip_for', call_get_local_ip_for) + d = iputil.get_local_addresses_async() def _check(addresses): - self.failUnlessEquals(set(addresses), set(["127.0.0.1", "192.168.0.6", "192.168.0.2"])) + self.failUnlessEquals(set(addresses), set(["127.0.0.1", "192.168.0.6", "192.168.0.2", "192.168.0.10"])) d.addCallbacks(_check) return d