コード例 #1
0
def test_point_setters():
    point = Point()

    point.x = 42
    point.y = 42

    assert point.x == 42.0
    assert point.y == 42.0
コード例 #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
コード例 #3
0
ファイル: test_point.py プロジェクト: OrLove101/w5.22.05.2021
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