def test_batch_get_assets_history(self):
        # Setup Expected Response
        expected_response = {}
        expected_response = asset_service_pb2.BatchGetAssetsHistoryResponse(
            **expected_response)

        # Mock the API response
        channel = ChannelStub(responses=[expected_response])
        client = asset_v1beta1.AssetServiceClient(channel=channel)

        # Setup Request
        parent = client.project_path('[PROJECT]')
        content_type = enums.ContentType.CONTENT_TYPE_UNSPECIFIED
        read_time_window = {}

        response = client.batch_get_assets_history(parent, content_type,
                                                   read_time_window)
        assert expected_response == response

        assert len(channel.requests) == 1
        expected_request = asset_service_pb2.BatchGetAssetsHistoryRequest(
            parent=parent,
            content_type=content_type,
            read_time_window=read_time_window)
        actual_request = channel.requests[0][1]
        assert expected_request == actual_request
    def test_batch_get_assets_history(self):
        # Setup Expected Response
        expected_response = {}
        expected_response = asset_service_pb2.BatchGetAssetsHistoryResponse(
            **expected_response)

        # Mock the API response
        channel = ChannelStub(responses=[expected_response])
        patch = mock.patch("google.api_core.grpc_helpers.create_channel")
        with patch as create_channel:
            create_channel.return_value = channel
            client = asset_v1beta1.AssetServiceClient()

        # Setup Request
        parent = client.project_path("[PROJECT]")
        content_type = enums.ContentType.CONTENT_TYPE_UNSPECIFIED
        read_time_window = {}

        response = client.batch_get_assets_history(parent, content_type,
                                                   read_time_window)
        assert expected_response == response

        assert len(channel.requests) == 1
        expected_request = asset_service_pb2.BatchGetAssetsHistoryRequest(
            parent=parent,
            content_type=content_type,
            read_time_window=read_time_window)
        actual_request = channel.requests[0][1]
        assert expected_request == actual_request