e4dcfc49aa
Tests / Lint and Format (push) Waiting to run
Tests / Web Node Tests (push) Waiting to run
Tests / Import Check (Python 3.11) (push) Waiting to run
Tests / Import Check (Python 3.12) (push) Waiting to run
Tests / Import Check (Python 3.13) (push) Waiting to run
Tests / Import Check (Python 3.14) (push) Waiting to run
Tests / Python Tests (Python 3.11) (push) Blocked by required conditions
Tests / Python Tests (Python 3.12) (push) Blocked by required conditions
Tests / Python Tests (Python 3.13) (push) Blocked by required conditions
Tests / Python Tests (Python 3.14) (push) Blocked by required conditions
Tests / Test Summary (push) Blocked by required conditions
16 lines
576 B
Python
16 lines
576 B
Python
from __future__ import annotations
|
|
|
|
import pytest
|
|
|
|
from deeptutor.knowledge.naming import validate_knowledge_base_name
|
|
|
|
|
|
def test_validate_knowledge_base_name_allows_unicode_and_spaces() -> None:
|
|
assert validate_knowledge_base_name(" 高等数学 KB ") == "高等数学 KB"
|
|
|
|
|
|
@pytest.mark.parametrize("name", ["bad/name", "bad\\name", "bad?name", "bad#name", "bad%name"])
|
|
def test_validate_knowledge_base_name_rejects_path_and_url_separators(name: str) -> None:
|
|
with pytest.raises(ValueError, match="reserved characters"):
|
|
validate_knowledge_base_name(name)
|