Skip to content

Commit 61d243f

Browse files
committed
chore: add special character test
1 parent 7c561e9 commit 61d243f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/file_keeper/default/adapters/standard.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,14 @@ def test_create_root_is_not_allowed(self, storage: fk.Storage, faker: Faker):
244244
with pytest.raises(fk.exc.LocationError):
245245
storage.upload(fk.Location(path), fk.make_upload(b""))
246246

247+
@pytest.mark.expect_storage_capability(fk.Capability.CREATE)
248+
def test_create_special_characters(self, storage: fk.Storage, faker: Faker):
249+
"""Filenames with special characters are supported."""
250+
special_name = "spécîål chåråçtęrs !@#$%^&()[]{};,文件.txt"
251+
result = storage.upload(fk.Location(special_name), fk.make_upload(b"hello"))
252+
assert result.location == special_name, "Location of the uploaded file was changed"
253+
assert storage.content(result) == b"hello", "Content of the uploaded file is incorrect"
254+
247255

248256
class Exister:
249257
@pytest.mark.expect_storage_capability(fk.Capability.EXISTS)

0 commit comments

Comments
 (0)