Skip to content

Commit 1f90452

Browse files
committed
Add test for include option
Takes into account work done in #60 and commit b88679c
1 parent 3d0f113 commit 1f90452

File tree

5 files changed

+110
-0
lines changed

5 files changed

+110
-0
lines changed

tests/examples/basic-include.html

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<div class="documentwrapper">
2+
<div class="bodywrapper">
3+
<div class="body" role="main">
4+
<table class="docutils align-default">
5+
<thead>
6+
<tr class="row-odd">
7+
<th class="head" colspan="1">
8+
<p>
9+
Title</p>
10+
</th>
11+
<th class="head" colspan="1">
12+
<p>
13+
Description</p>
14+
</th>
15+
<th class="head" colspan="1">
16+
<p>
17+
Type</p>
18+
</th>
19+
<th class="head" colspan="1">
20+
<p>
21+
Format</p>
22+
</th>
23+
<th class="head" colspan="1">
24+
<p>
25+
Required</p>
26+
</th>
27+
</tr>
28+
</thead>
29+
<tbody>
30+
<tr class="row-even">
31+
<td colspan="2">
32+
<code class="docutils literal notranslate" id="test.json,,id">
33+
<span class="pre">
34+
id</span>
35+
</code>
36+
</td>
37+
<td colspan="1">
38+
<p>
39+
string</p>
40+
</td>
41+
<td colspan="1">
42+
</td>
43+
<td colspan="1">
44+
</td>
45+
</tr>
46+
<tr class="row-odd">
47+
<td colspan="1">
48+
<p>
49+
None</p>
50+
</td>
51+
</tr>
52+
<tr class="row-even">
53+
<td colspan="2">
54+
<code class="docutils literal notranslate" id="test.json,,name/formal">
55+
<span class="pre">
56+
name/formal</span>
57+
</code>
58+
</td>
59+
<td colspan="1">
60+
<p>
61+
string</p>
62+
</td>
63+
<td colspan="1">
64+
</td>
65+
<td colspan="1">
66+
</td>
67+
</tr>
68+
<tr class="row-odd">
69+
<td colspan="1">
70+
<p>
71+
None</p>
72+
</td>
73+
</tr>
74+
</tbody>
75+
</table>
76+
</div>
77+
</div>
78+
</div>

tests/examples/basic-include/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
master_doc = 'index'
2+
extensions = ['sphinxcontrib.jsonschema']
3+
project = 'Test'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.. jsonschema:: subdir/test.json
2+
:include: id,name/formal
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"type": "object",
3+
"properties": {
4+
"id": {
5+
"type": "string"
6+
},
7+
"identifier": {
8+
"type": "string"
9+
},
10+
"name": {
11+
"type": "object",
12+
"properties": {
13+
"formal": {
14+
"type": "string"
15+
},
16+
"informal": {
17+
"type": "string"
18+
}
19+
}
20+
}
21+
}
22+
}

tests/test_directive.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,8 @@ def test_basic_remotejson(app, status, warning):
7171
@pytest.mark.sphinx(buildername='gettext', srcdir=path('basic-md'), freshenv=True)
7272
def test_basic_gettext_myst(app, status, warning):
7373
assert_build(app, status, warning, 'basic-md', buildername='gettext')
74+
75+
76+
@pytest.mark.sphinx(buildername='html', srcdir=path('basic-include'), freshenv=True)
77+
def test_basic_include(app, status, warning):
78+
assert_build(app, status, warning, 'basic-include')

0 commit comments

Comments
 (0)