Skip to content

Commit 0957c99

Browse files
committed
schema validation
1 parent 5022a63 commit 0957c99

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_validator.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import json
55
import responses
66
import unittest
7+
from jsonschema import Draft7Validator
78
from jsonschema.exceptions import ValidationError
89

910
from dynatademand.api import DemandAPIClient
@@ -18,6 +19,16 @@ def setUp(self):
1819
self.api = DemandAPIClient(client_id='test', username='testuser', password='testpass', base_host=BASE_HOST)
1920
self.api._access_token = 'Bearer testtoken'
2021

22+
def test_schemas(self):
23+
for schema_type in self.validator.schemas.keys():
24+
'''
25+
#TODO allow path schema validation when we receive valid ones
26+
'''
27+
if schema_type == 'path':
28+
continue
29+
for schema in self.validator.schemas[schema_type].values():
30+
Draft7Validator.check_schema(schema)
31+
2132
def test_query_params(self):
2233
self.validator.validate_request(
2334
'get_projects',

0 commit comments

Comments
 (0)