commit ed27df5b5e6c96c5e2978ca5c5874d5a314633f8 Author: Isis Lovecruft isis@torproject.org Date: Sat Mar 21 04:08:16 2015 +0000
Change unittest deduplicate() to not expect a DescriptorWarning. --- lib/bridgedb/test/test_parse_descriptors.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lib/bridgedb/test/test_parse_descriptors.py b/lib/bridgedb/test/test_parse_descriptors.py index 6a04861..2336a24 100644 --- a/lib/bridgedb/test/test_parse_descriptors.py +++ b/lib/bridgedb/test/test_parse_descriptors.py @@ -370,13 +370,14 @@ class ParseDescriptorsTests(unittest.TestCase):
def test_parse_descriptors_deduplicate_identical_timestamps(self): """Parsing two descriptors for the same bridge with identical - timestamps should raise a ``b.p.descriptors.DescriptorWarning``. + timestamps should log a ``b.p.descriptors.DescriptorWarning`` + and retain only one copy of the descriptor. """ descFileOne = io.BytesIO(BRIDGE_EXTRA_INFO_DESCRIPTOR) descFileTwo = io.BytesIO(BRIDGE_EXTRA_INFO_DESCRIPTOR) - self.assertRaises(descriptors.DescriptorWarning, - descriptors.parseExtraInfoFiles, - descFileOne, descFileTwo) + routers = descriptors.parseExtraInfoFiles(descFileOne, descFileTwo) + + self.assertEqual(len(routers), 1)
def test_parse_descriptors_parseExtraInfoFiles_two_files(self): """Test for ``b.p.descriptors.parseExtraInfoFiles`` with two
tor-commits@lists.torproject.org