예제 #1
0
def test_invalid_empty(valid_full_location):
    with pytest.raises(ValidationError):
        data = LocationSchema().load({})
예제 #2
0
def test_invalid_wrong_geometry_type(valid_full_location):
    # type multipoint, but point coordinates
    valid_full_location["geometry"]["type"] = "MultiPoint"

    with pytest.raises(ValidationError):
        data = LocationSchema().load(valid_full_location)
예제 #3
0
def test_valid_minimal(valid_minimal_location):
    assert valid_minimal_location == \
        LocationSchema().load(valid_minimal_location)
예제 #4
0
def test_invalid_geometry_type(valid_full_location):
    valid_full_location["geometry"]["type"] = "invalid"

    with pytest.raises(ValidationError):
        data = LocationSchema().load(valid_full_location)
예제 #5
0
def test_valid_full(valid_full_location):
    assert valid_full_location == LocationSchema().load(valid_full_location)