Download fixtures/pattern_lab/tests/test_guards.py from tailot/codex-python: direct link, hf CLI and curl.
- Browser
- Download file 551 Bytes
-
https://huggingface.co/datasets/tailot/codex-python/resolve/main/fixtures/pattern_lab/tests/test_guards.py
- Command line
-
hf download hf://datasets/tailot/codex-python/fixtures/pattern_lab/tests/test_guards.py
-
curl -L -o test_guards.py https://huggingface.co/datasets/tailot/codex-python/resolve/main/fixtures/pattern_lab/tests/test_guards.py
551 Bytes
| """Tests for src.guards.""" | |
| import pytest | |
| from src.guards import close_ticket, open_ticket | |
| def test_open_ticket_records_the_queue() -> None: | |
| assert open_ticket("builds") == {"queue": "builds", "opened": True} | |
| def test_open_ticket_refuses_an_empty_queue() -> None: | |
| with pytest.raises(AssertionError): | |
| open_ticket("") | |
| def test_close_ticket_clears_the_flag() -> None: | |
| closed = close_ticket(open_ticket("builds")) | |
| assert closed["opened"] is False | |
| with pytest.raises(AssertionError): | |
| close_ticket({"queue": ""}) | |