[tor-commits] [bridgedb/develop] Add better checks for vanilla IPv4 bridge lines in test_https.py.

isis at torproject.org isis at torproject.org
Mon Mar 23 00:53:59 UTC 2015


commit 414e6a577441a3ceaa207ccb771b839370ff456c
Author: Isis Lovecruft <isis at torproject.org>
Date:   Mon Mar 23 00:13:54 2015 +0000

    Add better checks for vanilla IPv4 bridge lines in test_https.py.
---
 lib/bridgedb/test/test_https.py |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/bridgedb/test/test_https.py b/lib/bridgedb/test/test_https.py
index fe9e4e3..6a40a67 100644
--- a/lib/bridgedb/test/test_https.py
+++ b/lib/bridgedb/test/test_https.py
@@ -24,6 +24,7 @@ repository.
 
 from __future__ import print_function
 
+import ipaddr
 import mechanize
 import os
 
@@ -211,8 +212,9 @@ class HTTPTests(unittest.TestCase):
                                   captchaResponse=CAPTCHA_RESPONSE)
         bridges = self.getBridgeLinesFromSoup(soup, fieldsPerBridge=2)
         for bridge in bridges:
-            # TODO: do more interesting checks
             self.assertTrue(bridge != None)
+            addr = bridge[0].rsplit(':', 1)[0]
+            self.assertIsInstance(ipaddr.IPAddress(addr), ipaddr.IPv4Address)
 
     def test_get_scramblesuit_ipv4(self):
         if os.environ.get("CI"):



More information about the tor-commits mailing list