Beispiel #1
0
def test_metrics_detailed_view(orderBy, session, client, jwt, app):
    token = jwt.create_jwt(get_token_body(), get_token_header())
    headers = {
        "Authorization": f"Bearer {token}",
        "content-type": "application/json"
    }

    rv = client.post("/form", headers=headers, json=get_form_request_payload())
    assert rv.status_code == 201
    form_id = rv.json.get("formId")
    mapper_id = rv.json.get("id")

    rv = client.post(
        "/application/create",
        headers=headers,
        json=get_application_create_payload(form_id),
    )
    assert rv.status_code == 201

    today = date.today().strftime("%Y-%m-%d")
    rv = client.get(
        f"/metrics/{mapper_id}?from={today}&to={today}&orderBy={orderBy}",
        headers=headers,
    )
    assert rv.status_code == 200
    assert rv.json.get("applications")
Beispiel #2
0
def test_process_get_all_processes(client, session, jwt):
    """Test process get all processes"""
    token = jwt.create_jwt(get_token_body(), get_token_header())
    headers = {
        "Authorization": f"Bearer {token}",
        "content-type": "application/json"
    }
    response = client.get("/application", headers=headers)
    assert response.status_code == 200
Beispiel #3
0
def test_form_process_mapper_by_formid(client, jwt):
    token = jwt.create_jwt(get_token_body(), get_token_header())
    headers = {"Authorization": f"Bearer {token}", "content-type": "application/json"}
    response = client.post(
        "/form",
        headers=headers,
        json=get_form_request_payload(),
    )
    assert response.status_code == 201
    form_id = response.json.get("formId")
    rv = client.get(f"/form/formid/{form_id}", headers=headers)
    assert rv.status_code == 200
Beispiel #4
0
def test_metrics_get_200(orderBy, session, client, jwt, app):
    token = jwt.create_jwt(get_token_body(), get_token_header())
    headers = {
        "Authorization": f"Bearer {token}",
        "content-type": "application/json"
    }

    today = date.today().strftime("%Y-%m-%d")
    rv = client.get(f"/metrics?from={today}&to={today}&orderBy={orderBy}",
                    headers=headers)
    assert rv.status_code == 200
    assert rv.status_code == 200
 def test_application_paginated_sorted_list(self, session, client, jwt,
                                            pageNo, limit, sortBy,
                                            sortOrder):
     token = jwt.create_jwt(get_token_body(), get_token_header())
     headers = {
         "Authorization": f"Bearer {token}",
         "content-type": "application/json",
     }
     response = client.get(
         f"/application?pageNo={pageNo}&limit={limit}&sortBy={sortBy}&sortOrder={sortOrder}",
         headers=headers,
     )
     assert response.status_code == 200
Beispiel #6
0
def test_form_process_mapper_detail_view(session, client, jwt, app):
    token = jwt.create_jwt(get_token_body(), get_token_header())
    headers = {"Authorization": f"Bearer {token}", "content-type": "application/json"}
    response = client.post(
        "/form",
        headers=headers,
        json=get_form_request_payload(),
    )
    assert response.status_code == 201
    mapper_id = response.json.get("id")
    rv = client.get(f"/form/{mapper_id}", headers=headers)
    assert rv.status_code == 200
    assert rv.json.get("id") == mapper_id
Beispiel #7
0
def test_form_process_mapper_list(session, client, jwt, app):
    token = jwt.create_jwt(get_token_body(), get_token_header())
    headers = {"Authorization": f"Bearer {token}", "content-type": "application/json"}
    response = client.get("/form", headers=headers)
    assert response.status_code == 200
Beispiel #8
0
def test_form_process_mapper_creation(session, client, jwt, app):
    token = jwt.create_jwt(get_token_body(), get_token_header())
    headers = {"Authorization": f"Bearer {token}", "content-type": "application/json"}
    response = client.post("/form", headers=headers, json=get_form_request_payload())
    assert response.status_code == 201
    assert response.json.get("id") != None