예제 #1
0
def test_point_distance():
    p1 = Point()
    p2 = Point(2, 4)

    assert p1.distance(p2) == 4.47213595499958
예제 #2
0
def test_point_distance_exception():
    with pytest.raises(TypeError):
        p1 = Point()
        p1.distance(dir)
예제 #3
0
def test_distance():
    p1 = Point()
    p2 = Point(2.0, 4.0)

    assert p1.distance(p2) == 3.1622776601683795