Skip to content
Myr

fix filename formatting test for Windows compatibility

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Windows does not support bytes paths, leading to UnicodeDecodeError when passing invalid UTF-8 bytes. Replaced the test input with a Unicode string containing the replacement character (�), which simulates the intended test case while working cross-platform.

authored by John Aziz · committed by John Aziz · parent bba0561 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • tests:+1 added−1 removed

1 file+1 added−1 removed

modified:tests/test_utils.py+1 added-1 removed
110 unmodified lines
111 assert click.format_filename(b"foo.txt") == "foo.txt"112 assert click.format_filename(b"/x/foo.txt") == "/x/foo.txt"113 assert click.format_filename("/x/foo.txt") == "/x/foo.txt"114 assert click.format_filename("/x/foo.txt", shorten=True) == "foo.txt"115 assert click.format_filename(b"/x/\xff.txt", shorten=True) == "�.txt"115 assert click.format_filename("/x/\ufffd.txt", shorten=True) == "�.txt"116117118def test_prompts(runner):119 @click.command()
539 unmodified lines