Skip to content

Commit 5842824

Browse files
Rework tests to explicit test forbidden chars
1 parent e4826dd commit 5842824

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tests/labtech/test_storage.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,16 @@ def test_key_with_slash_raises(self, local_storage: LocalStorage):
7373
local_storage.exists(os.path.sep + "key")
7474

7575
def test_backslash(self, local_storage: LocalStorage):
76-
if os.path.sep == "\\":
77-
with pytest.raises(StorageError):
78-
local_storage.exists("key\\with\\backslashes")
79-
else:
80-
assert not local_storage.exists("key\\with\\backslashes")
76+
with pytest.raises(StorageError):
77+
local_storage.exists("key\\with\\backslashes")
78+
79+
def test_dot(self, local_storage: LocalStorage):
80+
with pytest.raises(StorageError):
81+
local_storage.exists("key.with.dots")
82+
83+
def test_forwardslash(self, local_storage: LocalStorage):
84+
with pytest.raises(StorageError):
85+
local_storage.exists("key/with/forwardslashes")
8186

8287
def test_relative_path_trickery(self, local_storage: LocalStorage):
8388
key = "other_key"

0 commit comments

Comments
 (0)