mirror of
https://github.com/chidiwilliams/buzz.git
synced 2026-10-31 19:51:26 +00:00
Some checks are pending
CI / test (macos-latest) (push) Waiting to run
CI / test (ubuntu-latest) (push) Waiting to run
CI / test (windows-latest) (push) Waiting to run
CI / build (macos-latest) (push) Waiting to run
CI / build (ubuntu-latest) (push) Waiting to run
CI / build (windows-latest) (push) Waiting to run
CI / build_wheels (macos-latest) (push) Waiting to run
CI / build_wheels (ubuntu-latest) (push) Waiting to run
CI / build_wheels (windows-latest) (push) Waiting to run
CI / publish_pypi (push) Blocked by required conditions
CI / release (macos-latest) (push) Blocked by required conditions
CI / release (windows-latest) (push) Blocked by required conditions
GitHub Pages / Deploy (push) Waiting to run
Snapcraft / build (push) Waiting to run
Snapcraft / upload-edge (push) Blocked by required conditions
Snapcraft / upload-stable (push) Blocked by required conditions
Co-authored-by: raylei50653 <194683631+raylei50653@users.noreply.github.com>
18 lines
478 B
Python
18 lines
478 B
Python
import pytest
|
|
|
|
from buzz.paths import safe_filename_component
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"name,expected",
|
|
[
|
|
("中文 | QVD-123.", "中文 _ QVD-123#"),
|
|
("foo:bar?.wav", "foo_bar_.wav"),
|
|
("trailing-dot.", "trailing-dot#"),
|
|
("trailing-space ", "trailing-space#"),
|
|
("emoji-🚀", "emoji-🚀"),
|
|
("CON", "_CON"),
|
|
],
|
|
)
|
|
def test_safe_filename_component(name, expected):
|
|
assert safe_filename_component(name) == expected
|