Skip to content

Commit

Permalink
address PR comments: test naming, make assertions more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
KasiaKoz committed Nov 14, 2024
1 parent 7898cec commit f589f52
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/test_core_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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():
Expand Down

0 comments on commit f589f52

Please sign in to comment.