Skip to content

Commit

Permalink
Add test for include option
Browse files Browse the repository at this point in the history
Takes into account work done in
#60
and commit b88679c
  • Loading branch information
jarofgreen committed Nov 21, 2024
1 parent 3d0f113 commit 1f90452
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 0 deletions.
78 changes: 78 additions & 0 deletions tests/examples/basic-include.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<table class="docutils align-default">
<thead>
<tr class="row-odd">
<th class="head" colspan="1">
<p>
Title</p>
</th>
<th class="head" colspan="1">
<p>
Description</p>
</th>
<th class="head" colspan="1">
<p>
Type</p>
</th>
<th class="head" colspan="1">
<p>
Format</p>
</th>
<th class="head" colspan="1">
<p>
Required</p>
</th>
</tr>
</thead>
<tbody>
<tr class="row-even">
<td colspan="2">
<code class="docutils literal notranslate" id="test.json,,id">
<span class="pre">
id</span>
</code>
</td>
<td colspan="1">
<p>
string</p>
</td>
<td colspan="1">
</td>
<td colspan="1">
</td>
</tr>
<tr class="row-odd">
<td colspan="1">
<p>
None</p>
</td>
</tr>
<tr class="row-even">
<td colspan="2">
<code class="docutils literal notranslate" id="test.json,,name/formal">
<span class="pre">
name/formal</span>
</code>
</td>
<td colspan="1">
<p>
string</p>
</td>
<td colspan="1">
</td>
<td colspan="1">
</td>
</tr>
<tr class="row-odd">
<td colspan="1">
<p>
None</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
3 changes: 3 additions & 0 deletions tests/examples/basic-include/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
master_doc = 'index'
extensions = ['sphinxcontrib.jsonschema']
project = 'Test'
2 changes: 2 additions & 0 deletions tests/examples/basic-include/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. jsonschema:: subdir/test.json
:include: id,name/formal
22 changes: 22 additions & 0 deletions tests/examples/basic-include/subdir/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"identifier": {
"type": "string"
},
"name": {
"type": "object",
"properties": {
"formal": {
"type": "string"
},
"informal": {
"type": "string"
}
}
}
}
}
5 changes: 5 additions & 0 deletions tests/test_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,8 @@ def test_basic_remotejson(app, status, warning):
@pytest.mark.sphinx(buildername='gettext', srcdir=path('basic-md'), freshenv=True)
def test_basic_gettext_myst(app, status, warning):
assert_build(app, status, warning, 'basic-md', buildername='gettext')


@pytest.mark.sphinx(buildername='html', srcdir=path('basic-include'), freshenv=True)
def test_basic_include(app, status, warning):
assert_build(app, status, warning, 'basic-include')

0 comments on commit 1f90452

Please sign in to comment.