Download fixtures/pattern_lab/tests/test_registry.py from tailot/codex-python: direct link, hf CLI and curl.
- Browser
- Download file 470 Bytes
-
https://huggingface.co/datasets/tailot/codex-python/resolve/main/fixtures/pattern_lab/tests/test_registry.py
- Command line
-
hf download hf://datasets/tailot/codex-python/fixtures/pattern_lab/tests/test_registry.py
-
curl -L -o test_registry.py https://huggingface.co/datasets/tailot/codex-python/resolve/main/fixtures/pattern_lab/tests/test_registry.py
470 Bytes
| """Tests for src.registry.""" | |
| import pytest | |
| from src.registry import render | |
| def test_render_short_stringifies() -> None: | |
| assert render("short", 5) == "5" | |
| def test_render_long_names_the_type() -> None: | |
| assert render("long", 5) == "5 (int)" | |
| def test_render_json_sorts_parts() -> None: | |
| assert render("json", [3, 1, 2]) == ["1", "2", "3"] | |
| def test_render_rejects_an_unknown_kind() -> None: | |
| with pytest.raises(ValueError): | |
| render("yaml", 5) | |