Skip to content

Commit

Permalink
Add tests to get 100% coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
sgillies committed Jan 27, 2025
1 parent c6eed35 commit cc6e2b6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/test_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,6 @@ def __rmatmul__(self, other):
return other @ (1, 2)

assert Affine.identity() * TextPoint() == (1, 2)

assert Affine.identity() @ TextPoint() == (1, 2)


Expand All @@ -646,3 +645,14 @@ def test_init_invalid_h():
def test_init_invalid_i():
with pytest.raises(ValueError, match="i must"):
Affine(0, 0, 0, 0, 0, 0, 0, 0, 0)


def test_matmul_invalid_vector():
with pytest.raises(ValueError, match="must be 1.0"):
Affine.identity() @ (2.0, 3.0, 0.0)


@pytest.mark.parametrize("vec", [(2.0,), (2.0, 2.0, 1.0, 1.0)])
def test_matmul_invalid_vector_2(vec):
with pytest.raises(TypeError, match="2 or 3 values"):
Affine.identity() @ vec

0 comments on commit cc6e2b6

Please sign in to comment.