Skip to content

Commit df29847

Browse files
committed
add negative test case
1 parent b402d72 commit df29847

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

server/mergin/tests/test_utils.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,15 @@ def test_is_valid_path(client, filepath, allow):
228228
assert is_valid_path(filepath) == allow
229229

230230

231-
def test_has_trailing_space():
232-
assert has_trailing_space("photos /lutraHQ.jpg") is True
231+
test_paths = [
232+
("photos /lutraHQ.jpg", True),
233+
("photo s/ lutraHQ.jpg", False),
234+
]
235+
236+
237+
@pytest.mark.parametrize("path,result", test_paths)
238+
def test_has_trailing_space(path, result):
239+
assert has_trailing_space(path) is result
233240

234241

235242
def test_get_x_accell_uri(client):

0 commit comments

Comments
 (0)