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

[tor-commits] [bridgedb/develop] Add unittest for parsing empty extrainfo files.



commit d3e867231019a7401e7f6563833cc1e52f928d8d
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Fri Dec 5 09:35:04 2014 +0000

    Add unittest for parsing empty extrainfo files.
---
 lib/bridgedb/test/test_parse_descriptors.py |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/bridgedb/test/test_parse_descriptors.py b/lib/bridgedb/test/test_parse_descriptors.py
index b017dd6..0b81dd7 100644
--- a/lib/bridgedb/test/test_parse_descriptors.py
+++ b/lib/bridgedb/test/test_parse_descriptors.py
@@ -530,3 +530,9 @@ class ParseDescriptorsTests(unittest.TestCase):
         self.assertRaises(AttributeError,
                           descriptors.parseBridgeExtraInfoFiles,
                           descFileOne, descFileTwo, descFileThree)
+
+    def test_parse_descriptosrs_parseBridgeExtraInfoFiles_empty_file(self):
+        """Test parsing an empty extrainfo descriptors file."""
+        routers = descriptors.parseBridgeExtraInfoFiles(io.BytesIO(''))
+        self.assertIsInstance(routers, dict)
+        self.assertEqual(len(routers), 0)



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