Skip to content

Commit

Permalink
test_merge_in_radiuses_happy_not_only_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
aevri committed Jan 27, 2024
1 parent 5e18cf3 commit 837dbb5
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion tests/rotomap/test_automark.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,32 @@ def test_merge_in_radiuses_happy_only_merge():
assert result[1]["uuid"] == "2"
assert result[1]["radius"] == 12
assert result[2]["uuid"] == "3"
assert result[2]["radius"] == 18
assert result[2]["radius"] == 18


def test_merge_in_radiuses_happy_not_only_merge():
targets = [
{"uuid": "1", "x": 0, "y": 0},
{"uuid": "2", "x": 1, "y": 1},
{"uuid": "3", "x": 2, "y": 2}
]
radii_sources = [
{"uuid": "4", "radius": 7, "x": 0, "y": 0},
{"uuid": "5", "radius": 12, "x": 1, "y": 1},
{"uuid": "6", "radius": 18, "x": 2, "y": 2},
{"uuid": "7", "radius": 24, "x": 3, "y": 3},
]
error_distance = 3
only_merge = False

result = automark.merge_in_radiuses(targets, radii_sources, error_distance, only_merge)

assert len(result) == 4
assert result[0]["uuid"] == "1"
assert result[0]["radius"] == 7
assert result[1]["uuid"] == "2"
assert result[1]["radius"] == 12
assert result[2]["uuid"] == "3"
assert result[2]["radius"] == 18
assert result[3]["uuid"] == "7"
assert result[3]["radius"] == 24

0 comments on commit 837dbb5

Please sign in to comment.