[tor-commits] [bridgedb/master] Add unittest for parsing empty extrainfo files.
isis at torproject.org
isis at torproject.org
Sat Mar 21 02:02:58 UTC 2015
commit d3e867231019a7401e7f6563833cc1e52f928d8d
Author: Isis Lovecruft <isis at torproject.org>
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)
More information about the tor-commits
mailing list