Advertisement
hakegawa

Untitled

Jun 26th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. СХЕМА (SchemaRubricators.json)
  2. {
  3. "type":"array",
  4. "properties":{
  5. "alias":{
  6. "type":"string"
  7. },
  8. "description":{
  9. "type":"string"
  10. },
  11. "id":{
  12. "type":"number"
  13. }
  14. }
  15. }
  16. class ApiTesting(unittest.TestCase):
  17. api = ApiClient()
  18.  
  19. def validate_schema(self, schema, result):
  20. with open(schema) as data_file:
  21. schema = json.load(data_file)
  22.  
  23. Draft4Validator(schema).validate(result)
  24.  
  25. def test_get_rubricators_list(self):
  26. result = self.api.get('rubricators')['result']
  27.  
  28. self.validate_schema('SchemaRubricators.json', result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement