hankehly commented on code in PR #30981:
URL: https://github.com/apache/airflow/pull/30981#discussion_r1181365901
##########
tests/providers/google/cloud/hooks/test_pubsub.py:
##########
@@ -384,13 +395,14 @@ def test_publish_api_call_error(self, mock_service):
publish_method.side_effect = GoogleAPICallError(f"Error publishing to
topic {EXPANDED_SUBSCRIPTION}")
with pytest.raises(PubSubException):
- self.pubsub_hook.publish(project_id=TEST_PROJECT,
topic=TEST_TOPIC, messages=TEST_MESSAGES)
+ self.pubsub_hook.publish(project_id=TEST_PROJECT,
topic=TEST_TOPIC, messages=[{"data": b"test"}])
@mock.patch(PUBSUB_STRING.format("PubSubHook.subscriber_client"))
def test_pull(self, mock_service):
pull_method = mock_service.pull
pulled_messages = []
- for i, msg in enumerate(TEST_MESSAGES):
+ test_messages = [{"data": b"test1"}, {"data": b"test2"}]
Review Comment:
The content of the message does not matter. It could be `{"hello":"world"}`
and still succeed. Replaced with inline variable so we can remove
`TEST_MESSAGES` from the global scope.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]