def test_get_heart_rate(): p_id = _new_patient_id() hr_api.add_new_patient(p_id, "*****@*****.**", 21) hr_api.post_heart_rate(p_id, 90) resp = hr_api.get_heart_rate(p_id) assert resp == [90]
def test_get_patient_status(): p_id = _new_patient_id() hr_api.add_new_patient(p_id, "*****@*****.**", 21) hr_api.post_heart_rate(p_id, 90) is_tach, time = hr_api.get_patient_status(p_id) assert is_tach == False
def test_get_interval_average(): p_id = _new_patient_id() hr_api.add_new_patient(p_id, "*****@*****.**", 21) hr_api.post_heart_rate(p_id, 90) is_tach, time = hr_api.get_patient_status(p_id) hr_api.post_heart_rate(p_id, 100) avg = hr_api.get_interval_average(p_id, time) assert avg == 90
def test_get_patient_status_no_hr(): p_id = _new_patient_id() hr_api.add_new_patient(p_id, "*****@*****.**", 21) is_tach, time = hr_api.get_patient_status(p_id) assert is_tach is None and time is None
def test_post_heart_rate_bad(heart_rate, error): p_id = _new_patient_id() hr_api.add_new_patient(p_id, "*****@*****.**", 21) with pytest.raises(error): hr_api.post_heart_rate(p_id, heart_rate)
def test_add_new_patient_bad_inputs(inputs, error): with pytest.raises(error): hr_api.add_new_patient(inputs[0], inputs[1], inputs[2])
def test_add_new_patient(): p_id = _new_patient_id() hr_api.add_new_patient(p_id, "*****@*****.**", 21) assert True
def test_get_all_patients(): p_id = _new_patient_id() patient = hr_api.add_new_patient(p_id, "*****@*****.**", 21) assert hr_api.get_all_patients( )[p_id]["patient_id"] == patient["patient_id"]