def test_topology_normalization(topology_with_dupl_links, normalized_topology_example): """Проверка удаления дублей в топологии""" top_with_data = task_22_1a.Topology(topology_with_dupl_links) assert ( type(top_with_data.topology) == dict ), f"По заданию в переменной topology должен быть словарь, а не {type(top_with_data.topology).__name__}" assert len(top_with_data.topology) == len( normalized_topology_example ), "После создания экземпляра, в переменной topology должна находиться топология без дублей"
def test_topology_normalization(topology_with_dupl_links, normalized_topology_example): """Checking the removal of duplicates in a topology""" correct_topology = unify_topology_dict(normalized_topology_example) return_value = task_22_1a.Topology(topology_with_dupl_links) return_topology = unify_topology_dict(return_value.topology) assert ( type(return_value.topology) == dict ), f"topology attribute should be a dictionary, not a {type(top_with_data.topology).__name__}" assert len(correct_topology) == len( return_value.topology ), "After creating an instance, the topology attribute should contain a topology without duplicates" assert ( correct_topology == return_topology ), "After creating an instance, the topology attribute should contain a topology without duplicates"
def test_method_normalize(topology_with_dupl_links): """Проверяем, что в объекте Topology есть метод _normalize""" top_with_data = task_22_1a.Topology(topology_with_dupl_links) check_attr_or_method(top_with_data, method="_normalize")
def test_attr_topology(topology_with_dupl_links): """Проверяем, что в объекте Topology есть атрибут topology""" top_with_data = task_22_1a.Topology(topology_with_dupl_links) check_attr_or_method(top_with_data, attr="topology")
def test_method_normalize(topology_with_dupl_links): """Checking that the Topology object has method _normalize""" top_with_data = task_22_1a.Topology(topology_with_dupl_links) check_attr_or_method(top_with_data, method="_normalize")
def test_attr_topology(topology_with_dupl_links): """Checking that the Topology object has a topology attribute""" top_with_data = task_22_1a.Topology(topology_with_dupl_links) check_attr_or_method(top_with_data, attr="topology")