File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change 5
5
6
6
from config import BASE_URI
7
7
8
+ schema = {
9
+ "fname" : {'type' : 'string' },
10
+ "lname" : {'type' : 'string' },
11
+ "person_id" : {'type' : 'integer' },
12
+ "timestamp" : {'type' : 'string' }
13
+ }
8
14
9
- def test_read_all_operation_has_expected_schema ():
10
- schema = {
11
- "fname" : {'type' : 'string' },
12
- "lname" : {'type' : 'string' },
13
- "person_id" : {'type' : 'integer' },
14
- "timestamp" : {'type' : 'string' }
15
- }
16
15
16
+ def test_read_one_operation_has_expected_schema ():
17
+ response = requests .get (f'{ BASE_URI } /1' )
18
+ person = json .loads (response .text )
19
+
20
+ validator = Validator (schema )
21
+ is_valid = validator .validate (person )
22
+
23
+ if not is_valid :
24
+ print (validator .errors )
25
+
26
+
27
+ def test_read_all_operation_has_expected_schema ():
17
28
response = requests .get (BASE_URI )
18
29
persons = json .loads (response .text )
19
30
You can’t perform that action at this time.
0 commit comments