예제 #1
0
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]
예제 #2
0
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
예제 #3
0
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
예제 #4
0
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
예제 #5
0
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)
예제 #6
0
def test_add_new_patient_bad_inputs(inputs, error):
    with pytest.raises(error):
        hr_api.add_new_patient(inputs[0], inputs[1], inputs[2])
예제 #7
0
def test_add_new_patient():
    p_id = _new_patient_id()
    hr_api.add_new_patient(p_id, "*****@*****.**", 21)
    assert True
예제 #8
0
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"]