geometry tests

This commit is contained in:
Will McGugan
2022-03-24 15:13:31 +00:00
parent c90a2d42ed
commit 5d98a08933
2 changed files with 9 additions and 5 deletions

View File

@@ -251,6 +251,10 @@ def test_region_y_range():
assert Region(5, 10, 20, 30).y_range == range(10, 40)
def test_region_reset_origin():
assert Region(5, 10, 20, 30).reset_origin == Region(0, 0, 20, 30)
def test_region_expand():
assert Region(50, 10, 10, 5).expand((2, 3)) == Region(48, 7, 14, 11)
@@ -280,6 +284,10 @@ def test_spacing_bottom_right():
assert Spacing(2, 3, 4, 5).bottom_right == (3, 4)
def test_spacing_totals():
assert Spacing(2, 3, 4, 5).totals == (8, 6)
def test_spacing_css():
assert Spacing(1, 1, 1, 1).css == "1"
assert Spacing(1, 2, 1, 2).css == "1 2"