def test_invalid_empty(valid_full_location): with pytest.raises(ValidationError): data = LocationSchema().load({})
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)
def test_valid_minimal(valid_minimal_location): assert valid_minimal_location == \ LocationSchema().load(valid_minimal_location)
def test_invalid_geometry_type(valid_full_location): valid_full_location["geometry"]["type"] = "invalid" with pytest.raises(ValidationError): data = LocationSchema().load(valid_full_location)
def test_valid_full(valid_full_location): assert valid_full_location == LocationSchema().load(valid_full_location)