Beispiel #1
0
 def test_get_connection_status_4(self):
     """
     Active Connection, Existing Schedule
     """
     airbyte_base_url = f"http://localhost:8000/api/v1"
     responses.add(
         responses.POST,
         airbyte_base_url + "/connections/get/",
         json={
             "status": "active",
             "schedule": {
                 "units": "5"
             },
             "syncCatalog": ""
         },
         status=200,
     )
     responses.add(
         responses.POST,
         airbyte_base_url + "/connections/update/",
         json={},
         status=200,
     )
     session = requests.Session()
     connection_id = "749c19dc-4f97-4f30-bb0f-126e53506960"
     task = AirbyteConnectionTask(connection_id)
     response = task._get_connection_status(session, airbyte_base_url,
                                            connection_id)
     assert response == "active"
Beispiel #2
0
 def test_get_connection_status_3(self):
     """
     Deprecated Connection, No Schedule
     """
     airbyte_base_url = f"http://localhost:8000/api/v1"
     responses.add(
         responses.POST,
         airbyte_base_url + "/connections/get/",
         json={
             "status": "deprecated",
             "schedule": None
         },
         status=200,
     )
     session = requests.Session()
     connection_id = "749c19dc-4f97-4f30-bb0f-126e53506960"
     task = AirbyteConnectionTask(connection_id)
     response = task._get_connection_status(session, airbyte_base_url,
                                            connection_id)
     assert response == "deprecated"