Skip to content

Commit

Permalink
fix opensearch unit test
Browse files Browse the repository at this point in the history
This constant was removed because it was causing a circular import and I missed removing the references to it in the unit tests.
  • Loading branch information
ferruzzi committed Apr 29, 2024
1 parent 68f762a commit d2fba72
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
Expand Up @@ -58,7 +58,7 @@ def __init__(
status_message="Status of OpenSearch Serverless Collection is",
status_queries=["status"],
return_key="collection_id" if collection_id else "collection_name",
return_value=collection_id if collection_name else collection_name,
return_value=collection_id if collection_id else collection_name,
waiter_delay=waiter_delay,
waiter_max_attempts=waiter_max_attempts,
aws_conn_id=aws_conn_id,
Expand Down
Expand Up @@ -79,7 +79,7 @@ def test_name_and_id_combinations(self, collection_name, collection_id, expected
assert op.collection_name == collection_name
if not expected_pass:
with pytest.raises(
AttributeError, match=OpenSearchServerlessCollectionActiveSensor.INVALID_ARGS_MESSAGE
AttributeError, match="Either collection_ids or collection_names must be provided, not both."
):
OpenSearchServerlessCollectionActiveSensor(**call_args)

Expand Down
Expand Up @@ -22,9 +22,6 @@
import pytest

from airflow.providers.amazon.aws.hooks.opensearch_serverless import OpenSearchServerlessHook
from airflow.providers.amazon.aws.sensors.opensearch_serverless import (
OpenSearchServerlessCollectionActiveSensor,
)
from airflow.providers.amazon.aws.triggers.opensearch_serverless import (
OpenSearchServerlessCollectionActiveTrigger,
)
Expand Down Expand Up @@ -72,7 +69,7 @@ def test_serialization(self, collection_name, collection_id, expected_pass):

if not expected_pass:
with pytest.raises(
AttributeError, match=OpenSearchServerlessCollectionActiveSensor.INVALID_ARGS_MESSAGE
AttributeError, match="Either collection_ids or collection_names must be provided, not both."
):
OpenSearchServerlessCollectionActiveTrigger(**call_args)

Expand Down

0 comments on commit d2fba72

Please sign in to comment.