]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
test_iputil.py: repair a test by mocking 'get_local_ip_for'.
authorDaira Hopwood <david-sarah@jacaranda.org>
Tue, 25 Jun 2013 18:50:00 +0000 (19:50 +0100)
committerDaira Hopwood <david-sarah@jacaranda.org>
Tue, 25 Jun 2013 18:50:00 +0000 (19:50 +0100)
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
src/allmydata/test/test_iputil.py

index b56b8d23d105dcc64aacf833ebc68bd523697558..fcb101785d58d8f4c3e7250185148263154ce664 100644 (file)
@@ -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