[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [bridgedb/develop] Add test for b.p.d.parseNetworkStatusFile() with IPv6 primary ORAddress.



commit 4a4d2ec746ef277e3a915eeb895a5ae104098cce
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Sat Feb 14 03:14:58 2015 +0000

    Add test for b.p.d.parseNetworkStatusFile() with IPv6 primary ORAddress.
---
 lib/bridgedb/test/test_parse_descriptors.py |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/bridgedb/test/test_parse_descriptors.py b/lib/bridgedb/test/test_parse_descriptors.py
index 6395fdb..6a04861 100644
--- a/lib/bridgedb/test/test_parse_descriptors.py
+++ b/lib/bridgedb/test/test_parse_descriptors.py
@@ -286,6 +286,18 @@ class ParseDescriptorsTests(unittest.TestCase):
                           descriptors.parseNetworkStatusFile,
                           descFile)
 
+    def test_parse_descriptors_parseNetworkStatusFile_IPv6_ORAddress(self):
+        """A Bridge can't have its primary ORAddress be IPv6 without raising
+        a ValueError.
+        """
+        unparseable = BRIDGE_NETWORKSTATUS_0.replace(
+            '2.215.61.223', '[2837:fcd2:387b:e376:34c:1ec7:11ff:1686]')
+        descFile = self.writeTestDescriptorsToFile('networkstatus-bridges',
+                                                   unparseable)
+        self.assertRaises(ValueError,
+                          descriptors.parseNetworkStatusFile,
+                          descFile)
+
     def test_parse_descriptors_parseNetworkStatusFile_with_annotations(self):
         """Test ``b.p.descriptors.parseNetworkStatusFile`` with some document
         headers before the first 'r'-line.



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits