Example #1
0
def test_invalid_empty(valid_full_location):
    with pytest.raises(ValidationError):
        data = LocationSchema().load({})
Example #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)
Example #3
0
def test_valid_minimal(valid_minimal_location):
    assert valid_minimal_location == \
        LocationSchema().load(valid_minimal_location)
Example #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)
Example #5
0
def test_valid_full(valid_full_location):
    assert valid_full_location == LocationSchema().load(valid_full_location)