buzz/tests/paths_test.py
raylei50653 4c18d46d06
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
Fix URL downloads with trailing-dot titles on Windows (#1602)
Co-authored-by: raylei50653 <194683631+raylei50653@users.noreply.github.com>
2026-09-05 09:54:06 +03:00

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