def test_invalid_point_generation(): with pytest.raises(ValueError) as exp: Point("London UK", 12.11386, -555.08269) assert str(exp.value) == 'Invalid Latitude, Longitude combination' with pytest.raises(ValueError) as exp: Point(5, 12.11386, -55.08269) assert str(exp.value) == 'City name provided must be a string'
def test_make_one_point(): P1 = Point("Dakar", 17.4564, 18.6789) assert P1.get_lat_long() == ((17.4564, 18.6789))
def test_make_one_point(): p1 = Point("Dakar", 23.344, 21.355) assert p1.get_lat_long() == (23.344, 21.355)
def test_make_one_point(): p1 = Point("Dakar", 14.7167, 17.4677) assert p1.get_lat_long() == (14.7167, 17.4677)
def test_invalid_point_generation(): with pytest.raises(Exception) as exp: Point("Buenos Aires", 12.11286, -555.08268) breakpoint()
def test_make_one_point(): p1 = Point("Dakar", 123, 123) assert p1.get_lat_long() == (123, 123)
def test_invaild_point_generation(): with pytest.raises(ValueError) as exp: Point('Dakar', latitude=-100, longtitude=160) assert str(exp.value) == 'Invalid latitude, longtitude combination'
def test_store_points(): Point.store_points = [] p2 = Point('Dakar', 14.7167, 17.4677) assert Point.store_points == [p2]
def test_invalid_city_name_data_type(): with pytest.raises(ValueError) as exp: Point(313, 14.7167, 17.4677) assert str(exp.value) == 'Invalid name type, Should be string'
def test_make_one_point(): p1 = Point("Den Haag", 14.7167, 17.4672) assert p1.get_lat_long() == (14.7167, 17.4672)
def test_make_one_point(): p1 = Point("dakar", 14, 17) assert p1.get_lat_long() == (14, 17)