Beispiel #1
0
    def test_trigger_manual_sync_connection_2(self):
        airbyte_base_url = f"http://localhost:8000/api/v1"
        responses.add(responses.POST,
                      airbyte_base_url + "/connections/sync/",
                      json={},
                      status=404)
        session = requests.Session()
        connection_id = "749c19dc-4f97-4f30-bb0f-126e53506960"
        task = AirbyteConnectionTask(connection_id)

        with pytest.raises(ConnectionNotFoundException):
            task._trigger_manual_sync_connection(session, airbyte_base_url,
                                                 connection_id)
Beispiel #2
0
 def test_trigger_manual_sync_connection(self):
     airbyte_base_url = f"http://localhost:8000/api/v1"
     responses.add(
         responses.POST,
         airbyte_base_url + "/connections/sync/",
         json={"job": {
             "id": "1",
             "createdAt": "1234567890"
         }},
         status=200,
     )
     session = requests.Session()
     connection_id = "749c19dc-4f97-4f30-bb0f-126e53506960"
     task = AirbyteConnectionTask(connection_id)
     job_id, job_created_at = task._trigger_manual_sync_connection(
         session, airbyte_base_url, connection_id)
     assert job_id == "1"
     assert job_created_at == "1234567890"