Skip to content

Commit

Permalink
Review changes; fixed databrew waiter test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ellisms committed Jan 26, 2024
1 parent 115a6e4 commit 1b20b51
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 32 deletions.
1 change: 0 additions & 1 deletion docs/apache-airflow-providers-amazon/operators/neptune.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
Amazon Neptune
==============

With `AWS Lambda <https://aws.amazon.com/lambda/>`__,
`Amazon Neptune Database <https://aws.amazon.com/neptune/>`__ is a serverless graph database designed
for superior scalability and availability. Neptune Database provides built-in security,
continuous backups, and integrations with other AWS services.
Expand Down
30 changes: 0 additions & 30 deletions tests/providers/amazon/aws/triggers/test_neptune.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,33 +80,3 @@ async def test_run_success(self, mock_async_conn, mock_get_waiter):

assert resp == TriggerEvent({"status": "success", "db_cluster_id": CLUSTER_ID})
assert mock_get_waiter().wait.call_count == 1

# @pytest.mark.asyncio
# @mock.patch("airflow.providers.amazon.aws.hooks.neptune.NeptuneHook.get_waiter")
# @mock.patch("airflow.providers.amazon.aws.hooks.neptune.NeptuneHook.async_conn")
# async def test_run_failure(self, mock_async_conn, mock_get_waiter):
# # TODO: need to test what happens when waiter fails
# # mock_async_conn.__aenter__.return_value = 'Deleting'
# # mock_get_waiter().wait = AsyncMock()
# # trigger = NeptuneClusterAvailableTrigger(db_cluster_id=CLUSTER_ID)
# # generator = trigger.run()
# # resp = await generator.asend(None)
# a_mock = mock.MagicMock()
# mock_get_waiter.__aenter__.return_value = a_mock
# wait_mock = AsyncMock()
# wait_mock.side_effect = [
# WaiterError("name", "reason", {"tasks": [{"lastStatus": "my_status"}]}),
# WaiterError("name", "reason", {"tasks": [{"lastStatus": "my_status"}]}),
# WaiterError("terminal failure", "reason", {}),
# ]
# a_mock.get_waiter().wait = wait_mock

# trigger = NeptuneClusterAvailableTrigger(
# db_cluster_id=CLUSTER_ID, waiter_delay=1, waiter_max_attempts=1
# )

# with pytest.raises(WaiterError):
# generator = trigger.run()
# await generator.asend(None)

# assert resp == TriggerEvent({'status': 'failure', 'db_cluster_id': CLUSTER_ID})
1 change: 0 additions & 1 deletion tests/providers/amazon/aws/waiters/test_glue_databrew.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,3 @@ def test_job_succeeded(self, mock_describe_job_runs):
]
waiter = GlueDataBrewHook(aws_conn_id=None).get_waiter("job_complete")
waiter.wait(name=self.JOB_NAME, runId=self.RUN_ID, WaiterConfig={"Delay": 0.2, "MaxAttempts": 2})
waiter.wait.assert_called()

0 comments on commit 1b20b51

Please sign in to comment.