[bridgedb/master] Fix two unittests for PortList.__getitem__().

commit b6a9b30ec431fdcf7c72971970d2fa37c7144b4a Author: Isis Lovecruft <isis@torproject.org> Date: Wed Dec 11 04:13:36 2013 +0000 Fix two unittests for PortList.__getitem__(). * FIXES two unittests which erroneously passed before the previous commit which fixed #10333, and then erroneously failed after the fix. They should now correctly test indexing the portlist. --- lib/bridgedb/test/test_parse_addr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bridgedb/test/test_parse_addr.py b/lib/bridgedb/test/test_parse_addr.py index a7d02e3..25e7019 100644 --- a/lib/bridgedb/test/test_parse_addr.py +++ b/lib/bridgedb/test/test_parse_addr.py @@ -583,13 +583,13 @@ class PortListTest(unittest.TestCase): """Test ``__getitem__`` with a port number in the PortList.""" ports = (443, 9001, 9030) portList = addr.PortList(*ports) - self.assertTrue(portList.__getitem__(443)) + self.assertTrue(portList.__getitem__(0)) def test_getitem_shouldNotContain(self): """Test ``__getitem__`` with a port number not in the PortList.""" ports = (443, 9001, 9030) portList = addr.PortList(*ports) - self.assertRaises(ValueError, portList.__getitem__, 555) + self.assertRaises(IndexError, portList.__getitem__, 555) def test_mixedArgs(self): """Create a :class:`addr.PortList` with mixed type parameters."""
participants (1)
-
isis@torproject.org