import requests import json from config import url_base def test_doc_get(): response = requests.get(url_base() + "/api/Doc") data = json.loads(response.text) assert data["status"] == 0 for val in data["body"].values(): assert "firstName" in val def test_doc_assistants(): doc_id = "a23f" response = requests.get(url_base() + "/api/Doc/" + doc_id + "/assistants") data = json.loads(response.text) assert data["status"] == 0 for key, val in data["body"].items(): assert key == "doctorID" or "firstName" in val if key == "doctorID": assert val == doc_id def test_doc_children(): doc_id = "a23f" response = requests.get(url_base() + "/api/Doc/" + doc_id + "/children") data = json.loads(response.text) assert data["status"] == 0 for key, val in data["body"].items(): assert key == "doctorID" or "firstName" in val if key == "doctorID": assert val == doc_id