Beispiel #1
0
def test_point_setters():
    point = Point()

    point.x = 42
    point.y = 42

    assert point.x == 42.0
    assert point.y == 42.0
Beispiel #2
0
def test_point_setters_exception(value, exception_type):
    point = Point()

    with pytest.raises(exception_type):
        point.x = value

    with pytest.raises(exception_type):
        point.y = value
Beispiel #3
0
def test_setters():
    point = Point()

    assert point.x == POINT_DEFAULT
    assert point.y == POINT_DEFAULT

    point.x = POINT_NEW_VALUE
    point.y = POINT_NEW_VALUE

    assert point.x == POINT_NEW_VALUE
    assert point.y == POINT_NEW_VALUE