def test_add_iptag_then_locate_tag(self): """ check that locating a iptag via get_ip_tags_for_vertex function """ tag_info = Tags() iptag = IPTag("", 0, 0, 1, "122.2.2.2", 1, False) machine_vertex = SimpleMachineVertex(None, "") tag_info.add_ip_tag(iptag, machine_vertex) gotton_tag = tag_info.get_ip_tags_for_vertex(machine_vertex) self.assertEqual(gotton_tag[0], iptag)
def test_add_iptag_then_fail_to_locate(self): """ test that asking for a invalid iptag returns a None value """ tag_info = Tags() iptag = IPTag("", 0, 0, 1, "122.2.2.2", 1, False) machine_vertex = SimpleMachineVertex(None, "") machine_vertex_2 = SimpleMachineVertex(None, "") tag_info.add_ip_tag(iptag, machine_vertex) gotton_tag = tag_info.get_ip_tags_for_vertex(machine_vertex_2) self.assertEqual(gotton_tag, None)