def test_modify_push_config(self):
        channel = ChannelStub()
        client = subscriber_client.SubscriberClient(channel=channel)

        # Setup Request
        subscription = client.subscription_path('[PROJECT]', '[SUBSCRIPTION]')
        push_config = {}

        client.modify_push_config(subscription, push_config)

        assert len(channel.requests) == 1
        expected_request = pubsub_pb2.ModifyPushConfigRequest(
            subscription=subscription, push_config=push_config)
        actual_request = channel.requests[0][1]
        assert expected_request == actual_request
Esempio n. 2
0
    def test_modify_push_config(self):
        channel = ChannelStub()
        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
        with patch as create_channel:
            create_channel.return_value = channel
            client = subscriber_client.SubscriberClient()

        # Setup Request
        subscription = client.subscription_path('[PROJECT]', '[SUBSCRIPTION]')
        push_config = {}

        client.modify_push_config(subscription, push_config)

        assert len(channel.requests) == 1
        expected_request = pubsub_pb2.ModifyPushConfigRequest(
            subscription=subscription, push_config=push_config)
        actual_request = channel.requests[0][1]
        assert expected_request == actual_request