Exemplo n.º 1
0
def test_survey_tla_handler_returns_error_when_survey_tla_is_not_a_valid_survey_tla(
        client, survey_tla):
    request = client.post(
        f"/api/reports/call-pattern/matpal?start-date=2021-01-01&end-date=2021-01-01&survey-tla={survey_tla}"
    ).request
    with pytest.raises(BertException) as err:
        survey_tla_handler(request)
    assert err.value.message == f"Invalid request, {survey_tla} is not a valid survey three letter acronym"
    assert err.value.code == 400
def call_pattern(interviewer):
    start_date, end_date = date_handler(request)
    survey_tla = survey_tla_handler(request)
    questionnaires = questionnaire_handler(request)
    results = get_call_pattern_report(interviewer, start_date, end_date, survey_tla, questionnaires)
    if results == {}:
        return {}
    else:
        return results.json()
Exemplo n.º 3
0
def test_survey_tla_handler_returns_none_when_survey_tla_value_is_undefined(
        client):
    request = client.post(
        f"/api/reports/call-history/matpal?start-date=2021-01-01&end-date=2021-01-01&survey-tla=undefined"
    ).request
    assert survey_tla_handler(request) is None
Exemplo n.º 4
0
def test_survey_tla_handler_returns_none_when_survey_tla_parameter_is_not_provided(
        client):
    request = client.post(
        f"/api/reports/call-history/matpal?start-date=2021-01-01&end-date=2021-01-01"
    ).request
    assert survey_tla_handler(request) is None
Exemplo n.º 5
0
def test_survey_tla_handler_returns_upper_case_tla(client, survey_tla,
                                                   expected):
    request = client.post(
        f"/api/reports/call-history/matpal?start-date=2021-01-01&end-date=2021-01-01&survey-tla={survey_tla}"
    ).request
    assert survey_tla_handler(request) == expected
def appointment_language_summary(date):
    survey_tla = survey_tla_handler(request)
    return jsonify(get_appointment_language_summary_by_date(date, survey_tla))
def appointment_resource_planning(date):
    survey_tla = survey_tla_handler(request)
    return jsonify(get_appointment_resource_planning_by_date(date, survey_tla))
def call_questionnaires(interviewer):
    start_date, end_date = date_handler(request)
    survey_tla = survey_tla_handler(request)
    return jsonify(get_questionnaires(interviewer, start_date, end_date, survey_tla))
def call_history(interviewer):
    start_date, end_date = date_handler(request)
    survey_tla = survey_tla_handler(request)
    questionnaires = questionnaire_handler(request)
    return jsonify(get_call_history_report(interviewer, start_date, end_date, survey_tla, questionnaires))