Skip to content

Commit 048a076

Browse files
committed
wip
1 parent 6b49fb8 commit 048a076

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_cli_metadata.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ def test_metadata_download_file(cli_runner):
8989

9090
@pytest.mark.usefixtures("_mock_image_metadata", "_isolated_filesystem")
9191
def test_metadata_download_file_no_write(cli_run):
92-
result = cli_run(["metadata", "download", "-o", "/metadata.csv"])
92+
# Use os.path.join to create a path that's invalid on the current platform
93+
import os
94+
95+
invalid_path = os.path.join(os.path.abspath(os.sep), "metadata.csv") # noqa: PTH100, PTH118
96+
result = cli_run(["metadata", "download", "-o", invalid_path])
9397
# it's important that the exit code is 2 and not 1, because the key constraint of this
9498
# functionality is that the user gets the error message before spending their time
9599
# downloading the data. exit code 2 is for usage errors with click.

0 commit comments

Comments
 (0)