generated from coulomb/repo-seed
Implement infospace scaffold and service baseline
This commit is contained in:
26
tests/test_api.py
Normal file
26
tests/test_api.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from http import HTTPStatus
|
||||
|
||||
from info_tech_canon.api import _route
|
||||
|
||||
|
||||
def test_api_route_inspect() -> None:
|
||||
status, payload = _route("/inspect", {}, None)
|
||||
|
||||
assert status == HTTPStatus.OK
|
||||
assert payload["ok"] is True
|
||||
assert payload["infospace"]["slug"] == "canon"
|
||||
|
||||
|
||||
def test_api_route_validate() -> None:
|
||||
status, payload = _route("/validate", {}, None)
|
||||
|
||||
assert status == HTTPStatus.OK
|
||||
assert payload["ok"] is True
|
||||
|
||||
|
||||
def test_api_route_unknown_endpoint() -> None:
|
||||
status, payload = _route("/missing", {}, None)
|
||||
|
||||
assert status == HTTPStatus.NOT_FOUND
|
||||
assert payload["ok"] is False
|
||||
assert payload["error"]["code"] == "not_found"
|
||||
Reference in New Issue
Block a user