import pytest from pandemonium import Transform2D, Vector2, Rect2 def test_init(): v = Transform2D() assert type(v) == Transform2D args = (Vector2(1, 2), Vector2(3, 4), Vector2(5, 6)) v2 = Transform2D(*args) assert type(v) == Transform2D assert v2 == Transform2D(*args) assert v != v2 @pytest.mark.parametrize( "args", [ ("NaN", Vector2(), Vector2()), (Vector2(), "NaN", Vector2()), (Vector2(), Vector2(), "Nan"), (None, Vector2(), Vector2()), (Vector2(), None, Vector2()), (Vector2(), Vector2(), None), ], ) def test_bad_init(args): with pytest.raises(TypeError): Transform2D(*args) def test_repr(): v = Transform2D() assert repr(v).startswith("