mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-21 18:06:46 +00:00
test_iputil.py: repair a test by mocking 'get_local_ip_for'.
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
This commit is contained in:
parent
a493ee0bb6
commit
b31a4f6e87
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user