def test_contains_all_ips_failure(self): """ :class:`ContainsAllIPs` fail when the nodes contain only some or none of the all the IPs given. """ matcher = ContainsAllIPs(['10.0.0.1', '10.0.0.2', '10.0.0.2']) self.assertNotEqual( None, matcher.match([{'id': i, 'address': '10.0.0.{0}'.format(i)} for i in (1, 3)]), "Partial match succeeds when all should be required." ) self.assertNotEqual(None, matcher.match([]), "No matches succed.")
def test_contains_all_ips_failure(self): """ :class:`ContainsAllIPs` fail when the nodes contain only some or none of the all the IPs given. """ matcher = ContainsAllIPs(['10.0.0.1', '10.0.0.2', '10.0.0.2']) self.assertNotEqual( None, matcher.match([{ 'id': i, 'address': '10.0.0.{0}'.format(i) } for i in (1, 3)]), "Partial match succeeds when all should be required.") self.assertNotEqual(None, matcher.match([]), "No matches succed.")
def test_contains_all_ips_success(self): """ :class:`ContainsAllIPs` succeeds when the nodes contain all the IPs given. """ matcher = ContainsAllIPs(['10.0.0.1', '10.0.0.2', '10.0.0.2']) mismatch = matcher.match([ {'id': i, 'address': '10.0.0.{0}'.format(i)} for i in (1, 2) ]) self.assertEqual(None, mismatch)
def test_contains_all_ips_success(self): """ :class:`ContainsAllIPs` succeeds when the nodes contain all the IPs given. """ matcher = ContainsAllIPs(['10.0.0.1', '10.0.0.2', '10.0.0.2']) mismatch = matcher.match([{ 'id': i, 'address': '10.0.0.{0}'.format(i) } for i in (1, 2)]) self.assertEqual(None, mismatch)