mirror of
https://github.com/simonw/datasette.git
synced 2026-06-12 12:06:57 +02:00
Add generated examples for table JSON extras
This commit is contained in:
parent
111eeaf370
commit
79c8aff31d
5 changed files with 562 additions and 82 deletions
|
|
@ -112,6 +112,16 @@ def test_table_filters_are_documented(documented_table_filters, subtests):
|
|||
assert f.key in documented_table_filters
|
||||
|
||||
|
||||
def test_table_extra_examples_are_documented():
|
||||
from datasette.views.table_extras import CountExtra
|
||||
|
||||
assert CountExtra.example.path == "/fixtures/facetable.json?_extra=count"
|
||||
content = (docs_path / "json_api.rst").read_text()
|
||||
section = content.split(".. _json_api_extra:")[-1].split(".. _table_arguments:")[0]
|
||||
assert "GET /fixtures/facetable.json?_extra=count" in section
|
||||
assert ".. code-block:: json" in section
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def documented_labels():
|
||||
labels = set()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue