@@ -31,7 +31,7 @@ def test_cli_bucket_flow(runner: CliRunner, tmpdir) -> None: # noqa: C901, PLR0
3131
3232 # Get username for path verification
3333 the_uuid = str (uuid .uuid4 ())[:8 ] # Use first 8 characters of a random UUID
34- username = psutil .Process ().username ()
34+ username = psutil .Process ().username (). replace ( " \\ " , "_" )
3535 test_prefix = f"{ the_uuid } /{ username } /test-cli"
3636
3737 # Step 1: Create test files in the temporary directory
@@ -87,12 +87,10 @@ def test_cli_bucket_flow(runner: CliRunner, tmpdir) -> None: # noqa: C901, PLR0
8787 file_path = f"{ test_prefix } /dir1/file{ i } .txt"
8888 else :
8989 file_path = f"{ test_prefix } /dir2/file{ i } .txt"
90- assert file_path in result .output . replace ( " \\ \\ " , " \\ " )
90+ assert file_path in normalize_output ( result .stdout )
9191
9292 # Step 4: Download the files to a subdirectory and verify they match content-wise
93- result = runner .invoke (
94- cli , ["bucket" , "download" , test_prefix .replace ("\\ \\ " , "\\ " ), "--destination" , tmpdir / "downloaded" ]
95- )
93+ result = runner .invoke (cli , ["bucket" , "download" , test_prefix , "--destination" , tmpdir / "downloaded" ])
9694 assert result .exit_code == 0
9795 assert "Summary: 9 downloaded, 0 failed, 9 total" in result .output
9896
@@ -138,7 +136,7 @@ def test_cli_bucket_flow(runner: CliRunner, tmpdir) -> None: # noqa: C901, PLR0
138136 file_path = f"{ test_prefix } /dir1/file{ i } .txt"
139137 else :
140138 file_path = f"{ test_prefix } /dir2/file{ i } .txt"
141- assert file_path not in normalize_output (result .stdout ). replace ( " \\ \\ " , " \\ " )
139+ assert file_path not in normalize_output (result .stdout )
142140
143141 # Step 8: Try to delete a file that doesn't exist
144142 non_existent_file = f"{ test_prefix } /file1.txt"
0 commit comments