From 72949e27e880a2ea290abad826ff5fc1e09bb5da Mon Sep 17 00:00:00 2001 From: david Date: Fri, 10 Jul 2009 23:30:32 +0000 Subject: [PATCH] Remove the test for the sort order of addresses. The idea behind that was that if a host had multiple addresses of the same type, they should be sorted numerically, not alphabetically. So 20.0.0.1 should come before 100.0.0.1. But the way Nmap works, I don't think a host can have more than one address of the same type, and it's not worth the code it would take to make them sort properly if it did. --- ndiff/ndifftest.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/ndiff/ndifftest.py b/ndiff/ndifftest.py index 193429311..fb9b8cb60 100755 --- a/ndiff/ndifftest.py +++ b/ndiff/ndifftest.py @@ -202,27 +202,6 @@ class address_test(unittest.TestCase): self.assertEqual(e, e) self.assertNotEqual(a, e) - def test_sort(self): - """Test the sort order of addresses.""" - l = [MACAddress("00:00:00:00:00:00"), IPv4Address("127.0.0.1"), IPv6Address("::1")] - l.sort() - self.assertEqual(["ipv4", "ipv6", "mac"], [a.type for a in l]) - - strings = ["3.0.0.0", "20.0.0.0", "100.0.0.2", "100.0.0.10"] - l = [IPv4Address(s) for s in strings] - l.sort() - self.assertEqual(strings, [a.s for a in l]) - - strings = ["3::", "20::", "100::2", "100::10"] - l = [IPv6Address(s) for s in strings] - l.sort() - self.assertEqual(strings, [a.s for a in l]) - - strings = ["20:00:00:00:00:00", "a0:00:00:00:00:20", "a0:00:00:00:00:a0"] - l = [MACAddress(s) for s in strings] - l.sort() - self.assertEqual(strings, [a.s for a in l]) - class port_test(unittest.TestCase): """Test the Port class.""" def test_spec_string(self):