예제 #1
0
def test_check_if_required_keys_present_with_missing_keys():
    required_keys = {"patientName", "villageNumber", "patientSex", "dob"}
    invalid_code = PatientValidation.check_if_required_keys_present(
        patient_request_body, required_keys)
    # invalid_code should return as a tuple that looks like:
    # ({'HTTP 400': 'The request body key {dob} is required.'}, 400)
    assert invalid_code[0]["HTTP 400"] is not None
    assert invalid_code[1] == 400
예제 #2
0
def test_check_if_required_keys_present_with_all_keys():
    required_keys = {"patientName", "villageNumber", "patientSex"}
    valid = PatientValidation.check_if_required_keys_present(
        patient_request_body, required_keys)
    assert valid is None