@pytest.mark.parametrize(
"input,expected",
[
("/data/tiedosto.txt", "/data/tiedosto.txt"),
("/data/tiedosto.txt ", "/data/tiedosto.txt "),
("/ti/edo/sto.txt", "/ti/edo/sto.txt"),
("/data/polku/", serializers.ValidationError),
("/data//tiedosto.txt", serializers.ValidationError),
("tiedosto.txt", serializers.ValidationError),
(" /tiedosto.txt", serializers.ValidationError),
],
)
def test_file_path_field(input, expected):
field = fields.FilePathField()
validate_input(field, input, expected)