test_transit: tolerate a localhost-only system

e.g. Appveyor . Refs #16.
This commit is contained in:
Brian Warner 2016-06-03 21:46:16 -07:00
parent b6ff5f3946
commit e13b95660b

View File

@ -171,6 +171,11 @@ class Basic(unittest.TestCase):
d.addBoth(results.append)
hints = results[0]
c._stop_listening()
# If there are non-localhost hints, then localhost hints should be
# removed. But if the only hint is localhost, it should stay.
if len(hints) == 1:
if hints[0][u'hostname'] == u'127.0.0.1':
return
for hint in hints:
self.assertFalse(hint[u'hostname'] == u'127.0.0.1')