Ejemplo n.º 1
0
    def test_get_job_status_2(self):
        airbyte_base_url = f"http://localhost:8000/api/v1"
        responses.add(responses.POST,
                      airbyte_base_url + "/jobs/get/",
                      json={},
                      status=404)
        session = requests.Session()
        connection_id = "749c19dc-4f97-4f30-bb0f-126e53506960"
        task = AirbyteConnectionTask(connection_id)

        job_id = "1"
        with pytest.raises(JobNotFoundException):
            task._get_job_status(session, airbyte_base_url, job_id)
Ejemplo n.º 2
0
 def test_get_job_status(self):
     airbyte_base_url = f"http://localhost:8000/api/v1"
     responses.add(
         responses.POST,
         airbyte_base_url + "/jobs/get/",
         json={
             "job": {
                 "status": "running",
                 "createdAt": "1234567890",
                 "updatedAt": "1234567890",
             }
         },
         status=200,
     )
     session = requests.Session()
     connection_id = "749c19dc-4f97-4f30-bb0f-126e53506960"
     task = AirbyteConnectionTask(connection_id)
     job_id = "1"
     job_status, job_created_at, job_updated_at = task._get_job_status(
         session, airbyte_base_url, job_id)
     assert job_status == "running"
     assert job_created_at == "1234567890"
     assert job_updated_at == "1234567890"