codex-python / fixtures /pattern_lab /tests /test_registry.py
tailot's picture
Upload folder using huggingface_hub
1600cd6 verified
Raw History Blame Contribute Delete
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)