From: Daira Hopwood <david-sarah@jacaranda.org>
Date: Tue, 25 Jun 2013 22:32:02 +0000 (+0100)
Subject: test_iputil.py: repair a test for cygwin (which is intended to behave differently).
X-Git-Tag: allmydata-tahoe-1.10.1a1~229
X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/css/%22file:?a=commitdiff_plain;h=f97b8e5e1df75284aa9b89dd830f8728040eab67;p=tahoe-lafs%2Ftahoe-lafs.git

test_iputil.py: repair a test for cygwin (which is intended to behave differently).

Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
---

diff --git a/src/allmydata/test/test_iputil.py b/src/allmydata/test/test_iputil.py
index 00359a42..b89f43a5 100644
--- a/src/allmydata/test/test_iputil.py
+++ b/src/allmydata/test/test_iputil.py
@@ -1,5 +1,5 @@
 
-import re, errno, subprocess, os
+import re, errno, subprocess, os, sys
 
 from twisted.trial import unittest
 
@@ -105,12 +105,19 @@ class ListAddresses(testutil.SignalMixin, unittest.TestCase):
         self.patch(subprocess, 'Popen', call_Popen)
 
         def call_get_local_ip_for(target):
-            return "192.168.0.10"
+            if target in ("localhost", "127.0.0.1"):
+                return "127.0.0.1"
+            else:
+                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", "192.168.0.10"]))
+            if sys.platform == "cygwin":
+                expected = set(["127.0.0.1", "192.168.0.10"])
+            else:
+                expected = set(["127.0.0.1", "192.168.0.6", "192.168.0.2", "192.168.0.10"])
+            self.failUnlessEquals(set(addresses), expected)
         d.addCallbacks(_check)
         return d