From 71734a3d09269b987d56d21c4e7f1eeb432d49ef Mon Sep 17 00:00:00 2001 From: Ronan Lamy Date: Mon, 19 Sep 2022 16:09:40 +0100 Subject: [PATCH] ls-url: fix test_file() on Windows and add another case --- tests/func/test_ls_url.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/func/test_ls_url.py b/tests/func/test_ls_url.py index 57a665d0b..9340611ce 100644 --- a/tests/func/test_ls_url.py +++ b/tests/func/test_ls_url.py @@ -12,11 +12,13 @@ def match_files(entries, expected): assert entries_content == expected_content -def test_file(tmp_dir): - tmp_dir.gen({"foo": "foo contents"}) +@pytest.mark.parametrize("fname", ["foo", "dir/foo"]) +def test_file(tmp_dir, fname): + tmp_dir.gen({fname: "foo contents"}) - result = Repo.ls_url("foo") - match_files(result, [{"path": os.path.abspath("foo"), "isdir": False}]) + (d,) = Repo.ls_url(fname) + assert d["isdir"] is False + assert os.path.normpath(d["path"]) == os.path.abspath(fname) def test_dir(tmp_dir):