Skip to content

Commit 9355965

Browse files
authored
Merge pull request #120 from seagreen/extract-test-schema
Extract the schema for tests into a JSON file.
2 parents 2f0d6e3 + 42ba0f9 commit 9355965

File tree

2 files changed

+28
-27
lines changed

2 files changed

+28
-27
lines changed

bin/jsonschema_suite

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -52,33 +52,8 @@ REMOTES = {
5252
}
5353
REMOTES_DIR = os.path.join(ROOT_DIR, "remotes")
5454

55-
TESTSUITE_SCHEMA = {
56-
"$schema": "http://json-schema.org/draft-03/schema#",
57-
"type": "array",
58-
"items": {
59-
"type": "object",
60-
"properties": {
61-
"description": {"type": "string", "required": True},
62-
"schema": {"required": True},
63-
"tests": {
64-
"type": "array",
65-
"items": {
66-
"type": "object",
67-
"properties": {
68-
"description": {"type": "string", "required": True},
69-
"data": {"required": True},
70-
"valid": {"type": "boolean", "required": True}
71-
},
72-
"additionalProperties": False
73-
},
74-
"minItems": 1
75-
}
76-
},
77-
"additionalProperties": False,
78-
"minItems": 1
79-
}
80-
}
81-
55+
with open(os.path.join(ROOT_DIR, "test-schema.json")) as schema:
56+
TESTSUITE_SCHEMA = json.load(schema)
8257

8358
def files(paths):
8459
for path in paths:

test-schema.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-03/schema#",
3+
"type": "array",
4+
"items": {
5+
"type": "object",
6+
"properties": {
7+
"description": {"type": "string", "required": true},
8+
"schema": {"required": true},
9+
"tests": {
10+
"type": "array",
11+
"items": {
12+
"type": "object",
13+
"properties": {
14+
"description": {"type": "string", "required": true},
15+
"data": {"required": true},
16+
"valid": {"type": "boolean", "required": true}
17+
},
18+
"additionalProperties": false
19+
},
20+
"minItems": 1
21+
}
22+
},
23+
"additionalProperties": false,
24+
"minItems": 1
25+
}
26+
}

0 commit comments

Comments
 (0)