This commit is contained in:
Will McGugan
2023-02-17 18:14:13 +00:00
parent 0ac7eef4b5
commit 31c8fb2818

View File

@@ -46,11 +46,19 @@ def test_get_values_in_region() -> None:
[ [
(Region(10, 5, 5, 5), False, "foo"), (Region(10, 5, 5, 5), False, "foo"),
(Region(5, 20, 5, 5), False, "bar"), (Region(5, 20, 5, 5), False, "bar"),
(Region(0, 0, 40, 1), True, "title"),
] ]
) )
assert spatial_map.get_values_in_region(Region(0, 0, 10, 5)) == ["foo"] assert spatial_map.get_values_in_region(Region(0, 0, 10, 5)) == [
assert spatial_map.get_values_in_region(Region(0, 1, 10, 5)) == ["foo"] "title",
assert spatial_map.get_values_in_region(Region(0, 10, 10, 5)) == [] "foo",
assert spatial_map.get_values_in_region(Region(0, 20, 10, 5)) == ["bar"] ]
assert spatial_map.get_values_in_region(Region(5, 5, 50, 50)) == ["foo", "bar"] assert spatial_map.get_values_in_region(Region(0, 1, 10, 5)) == ["title", "foo"]
assert spatial_map.get_values_in_region(Region(0, 10, 10, 5)) == ["title"]
assert spatial_map.get_values_in_region(Region(0, 20, 10, 5)) == ["title", "bar"]
assert spatial_map.get_values_in_region(Region(5, 5, 50, 50)) == [
"title",
"foo",
"bar",
]