Skip to content

Commit

Permalink
test_automark: first happy-path test with Codium
Browse files Browse the repository at this point in the history
  • Loading branch information
aevri committed Jan 26, 2024
1 parent 5877d7d commit f544040
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/rotomap/test_automark.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""Test suite for mel.rotomap.relate."""

import mel.rotomap.automark as automark


# returns a list of targets with updated radii if there are matching radii sources within error_distance
def test_targets_with_updated_radii():
# Arrange
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},
]
error_distance = 3
only_merge = False

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

# Assert
assert len(result) == 3
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

0 comments on commit f544040

Please sign in to comment.