integration test

PHOTO EMBED

Mon Apr 26 2021 12:32:54 GMT+0000 (Coordinated Universal Time)

Saved by @opencv

with open(input_file_path, "rb") as f:
        response = requests.post(
            f"{BASE_URL}/{API_VERSION}/process?model_id={model_id}",
            headers=headers,
            files={"upload_data": (osp.basename(input_file_path), f)},
        )

    assert response.status_code == 201

    task_id = json.loads(response.content)["task_id"]

    result = repeated_get_task(access_token, task_id, repeat_result)
    assert result is not None

    visualization = repeated_get_task(
        access_token, task_id, repeat_visualization, visualize=True,
    )
    assert bool(visualization)

    response = requests.get(visualization, headers=headers)
    assert response.status_code == 200

    if check_is_equal:
        assert is_equal(result, output_file, error=0.3)
content_copyCOPY