Skip to content

Commit

Permalink
fix provider checks test
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdigati committed Jun 1, 2024
1 parent 1916a47 commit 6802b86
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/providers/google/cloud/hooks/test_pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from google.api_core.exceptions import AlreadyExists, GoogleAPICallError
from google.api_core.gapic_v1.method import DEFAULT
from google.cloud.exceptions import NotFound
from google.cloud.pubsub_v1.types import ReceivedMessage
from google.cloud.pubsub_v1.types import PublisherOptions, ReceivedMessage
from googleapiclient.errors import HttpError

from airflow.providers.google.cloud.hooks.pubsub import PubSubAsyncHook, PubSubException, PubSubHook
Expand Down Expand Up @@ -86,7 +86,12 @@ def setup_method(self):
def test_publisher_client_creation(self, mock_client, mock_get_creds):
assert self.pubsub_hook._client is None
result = self.pubsub_hook.get_conn()
mock_client.assert_called_once_with(credentials=mock_get_creds.return_value, client_info=CLIENT_INFO)

mock_client.assert_called_once_with(
credentials=mock_get_creds.return_value,
client_info=CLIENT_INFO,
publisher_options=PublisherOptions(enable_message_ordering=False),
)
assert mock_client.return_value == result
assert self.pubsub_hook._client == result

Expand Down

0 comments on commit 6802b86

Please sign in to comment.