Skip to content

Commit

Permalink
green test
Browse files Browse the repository at this point in the history
  • Loading branch information
awaistkd committed Feb 28, 2024
1 parent 0c7854b commit bfb5fcd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rele/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(
self._ack_deadline = default_ack_deadline or DEFAULT_ACK_DEADLINE
self.credentials = credentials if not USE_EMULATOR else None
self._message_storage_policy = message_storage_policy
self._client = pubsub_v1.SubscriberClient(credentials=credentials)
self._client = pubsub_v1.SubscriberClient(credentials=credentials, client_options=client_options)
self._retry_policy = default_retry_policy

def update_or_create_subscription(self, subscription):
Expand Down
4 changes: 2 additions & 2 deletions tests/commands/test_runrele.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_calls_worker_start_and_setup_when_runrele(self, mock_worker):
call_command("runrele")

mock_worker.assert_called_with(
[], "rele-test", ANY, "europe-west1", 60, 2, None
[], None, "rele-test", ANY, "europe-west1", 60, 2, None
)
mock_worker.return_value.run_forever.assert_called_once_with()

Expand All @@ -35,6 +35,6 @@ def test_prints_warning_when_conn_max_age_not_set_to_zero(
"be exhausted." in err
)
mock_worker.assert_called_with(
[], "rele-test", ANY, "europe-west1", 60, 2, None
[], None, "rele-test", ANY, "europe-west1", 60, 2, None
)
mock_worker.return_value.run_forever.assert_called_once_with()
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def mock_worker():
@pytest.fixture
def subscriber(project_id, config):
return Subscriber(
config.gc_project_id, config.credentials, config.gc_storage_region, 60
config.gc_project_id, config.credentials, config.gc_storage_region, config.client_options, 60
)


Expand Down
1 change: 1 addition & 0 deletions tests/test_subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ def test_default_retry_policy_is_applied_when_not_explicitly_provided(
config_with_retry_policy.gc_project_id,
config_with_retry_policy.credentials,
config_with_retry_policy.gc_storage_region,
config_with_retry_policy.client_options,
60,
config_with_retry_policy.retry_policy,
)
Expand Down
3 changes: 3 additions & 0 deletions tests/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def worker(config):
subscriptions = (sub_stub,)
return Worker(
subscriptions,
config.client_options,
config.gc_project_id,
config.credentials,
config.gc_storage_region,
Expand Down Expand Up @@ -115,6 +116,7 @@ def test_creates_subscription_with_custom_ack_deadline_from_environment(
custom_ack_deadline = 234
worker = Worker(
subscriptions,
config.client_options,
config.gc_project_id,
config.gc_storage_region,
config.credentials,
Expand Down Expand Up @@ -241,6 +243,7 @@ def test_waits_forever_when_called_with_config_and_subs(

mock_worker.assert_called_with(
subscriptions,
None,
"rele-test",
ANY,
"some-region",
Expand Down

0 comments on commit bfb5fcd

Please sign in to comment.