From f589f522d534c9a84e56ede302804e90e8623110 Mon Sep 17 00:00:00 2001 From: "kasia.kozlowska" Date: Thu, 14 Nov 2024 15:53:47 +0000 Subject: [PATCH] address PR comments: test naming, make assertions more clear --- tests/test_core_network.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_core_network.py b/tests/test_core_network.py index f7bd553c..4394a8ab 100644 --- a/tests/test_core_network.py +++ b/tests/test_core_network.py @@ -1938,7 +1938,7 @@ def test_adding_multiple_links_with_id_and_multi_idx_clashes(assert_semantically ) -def test_adding_many_links_with_id_and_multi_idx_clashes(assert_semantically_equal, mocker): +def test_avoids_destructive_index_clashes_when_adding_replacement_links(mocker): n = Network("epsg:27700") for i in range(3): n.add_link(str(i), 1, 2) @@ -1953,9 +1953,12 @@ def test_adding_many_links_with_id_and_multi_idx_clashes(assert_semantically_equ reindexing_dict, links_and_attribs = n.add_links(links_to_add) + assert ( + len(list(n.links())) == 5 + ), "Network does not have the expected number of links: 5 = (3 original - 1 removed) + 3 new links" assert ( len({v["multi_edge_idx"] for v in n.link_id_mapping.values()}) == 5 - ), "Some multiindices were not unique" + ), "Some multi-indices are not unique" def test_adding_multiple_links_missing_some_from_nodes():