Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.1.17" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.1.17" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# limitations under the License.
#
from collections import OrderedDict
import functools
import re
from typing import (
Callable,
Expand Down Expand Up @@ -199,9 +198,7 @@ def universe_domain(self) -> str:
"""
return self._client._universe_domain

get_transport_class = functools.partial(
type(PlacesClient).get_transport_class, type(PlacesClient)
)
get_transport_class = PlacesClient.get_transport_class

def __init__(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ def __init__(
transport_init: Union[
Type[PlacesTransport], Callable[..., PlacesTransport]
] = (
type(self).get_transport_class(transport)
PlacesClient.get_transport_class(transport)
if isinstance(transport, str) or transport is None
else cast(Callable[..., PlacesTransport], transport)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-maps-places",
"version": "0.1.17"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1221,22 +1221,23 @@ async def test_search_nearby_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
mock_object = mock.AsyncMock()
mock_rpc = mock.AsyncMock()
mock_rpc.return_value = mock.Mock()
client._client._transport._wrapped_methods[
client._client._transport.search_nearby
] = mock_object
] = mock_rpc

request = {}
await client.search_nearby(request)

# Establish that the underlying gRPC stub method was called.
assert mock_object.call_count == 1
assert mock_rpc.call_count == 1

await client.search_nearby(request)

# Establish that a new wrapper was not created for this call
assert wrapper_fn.call_count == 0
assert mock_object.call_count == 2
assert mock_rpc.call_count == 2


@pytest.mark.asyncio
Expand Down Expand Up @@ -1440,22 +1441,23 @@ async def test_search_text_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
mock_object = mock.AsyncMock()
mock_rpc = mock.AsyncMock()
mock_rpc.return_value = mock.Mock()
client._client._transport._wrapped_methods[
client._client._transport.search_text
] = mock_object
] = mock_rpc

request = {}
await client.search_text(request)

# Establish that the underlying gRPC stub method was called.
assert mock_object.call_count == 1
assert mock_rpc.call_count == 1

await client.search_text(request)

# Establish that a new wrapper was not created for this call
assert wrapper_fn.call_count == 0
assert mock_object.call_count == 2
assert mock_rpc.call_count == 2


@pytest.mark.asyncio
Expand Down Expand Up @@ -1661,22 +1663,23 @@ async def test_get_photo_media_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
mock_object = mock.AsyncMock()
mock_rpc = mock.AsyncMock()
mock_rpc.return_value = mock.Mock()
client._client._transport._wrapped_methods[
client._client._transport.get_photo_media
] = mock_object
] = mock_rpc

request = {}
await client.get_photo_media(request)

# Establish that the underlying gRPC stub method was called.
assert mock_object.call_count == 1
assert mock_rpc.call_count == 1

await client.get_photo_media(request)

# Establish that a new wrapper was not created for this call
assert wrapper_fn.call_count == 0
assert mock_object.call_count == 2
assert mock_rpc.call_count == 2


@pytest.mark.asyncio
Expand Down Expand Up @@ -2151,22 +2154,23 @@ async def test_get_place_async_use_cached_wrapped_rpc(transport: str = "grpc_asy
)

# Replace cached wrapped function with mock
mock_object = mock.AsyncMock()
mock_rpc = mock.AsyncMock()
mock_rpc.return_value = mock.Mock()
client._client._transport._wrapped_methods[
client._client._transport.get_place
] = mock_object
] = mock_rpc

request = {}
await client.get_place(request)

# Establish that the underlying gRPC stub method was called.
assert mock_object.call_count == 1
assert mock_rpc.call_count == 1

await client.get_place(request)

# Establish that a new wrapper was not created for this call
assert wrapper_fn.call_count == 0
assert mock_object.call_count == 2
assert mock_rpc.call_count == 2


@pytest.mark.asyncio
Expand Down Expand Up @@ -2604,22 +2608,23 @@ async def test_autocomplete_places_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
mock_object = mock.AsyncMock()
mock_rpc = mock.AsyncMock()
mock_rpc.return_value = mock.Mock()
client._client._transport._wrapped_methods[
client._client._transport.autocomplete_places
] = mock_object
] = mock_rpc

request = {}
await client.autocomplete_places(request)

# Establish that the underlying gRPC stub method was called.
assert mock_object.call_count == 1
assert mock_rpc.call_count == 1

await client.autocomplete_places(request)

# Establish that a new wrapper was not created for this call
assert wrapper_fn.call_count == 0
assert mock_object.call_count == 2
assert mock_rpc.call_count == 2


@pytest.mark.asyncio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.1.2" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.1.2" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# limitations under the License.
#
from collections import OrderedDict
import functools
import re
from typing import (
Callable,
Expand Down Expand Up @@ -211,9 +210,7 @@ def universe_domain(self) -> str:
"""
return self._client._universe_domain

get_transport_class = functools.partial(
type(RouteOptimizationClient).get_transport_class, type(RouteOptimizationClient)
)
get_transport_class = RouteOptimizationClient.get_transport_class

def __init__(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ def __init__(
Type[RouteOptimizationTransport],
Callable[..., RouteOptimizationTransport],
] = (
type(self).get_transport_class(transport)
RouteOptimizationClient.get_transport_class(transport)
if isinstance(transport, str) or transport is None
else cast(Callable[..., RouteOptimizationTransport], transport)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-maps-routeoptimization",
"version": "0.1.2"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1333,22 +1333,23 @@ async def test_optimize_tours_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
mock_object = mock.AsyncMock()
mock_rpc = mock.AsyncMock()
mock_rpc.return_value = mock.Mock()
client._client._transport._wrapped_methods[
client._client._transport.optimize_tours
] = mock_object
] = mock_rpc

request = {}
await client.optimize_tours(request)

# Establish that the underlying gRPC stub method was called.
assert mock_object.call_count == 1
assert mock_rpc.call_count == 1

await client.optimize_tours(request)

# Establish that a new wrapper was not created for this call
assert wrapper_fn.call_count == 0
assert mock_object.call_count == 2
assert mock_rpc.call_count == 2


@pytest.mark.asyncio
Expand Down Expand Up @@ -1570,8 +1571,9 @@ def test_batch_optimize_tours_use_cached_wrapped_rpc():
# Establish that the underlying gRPC stub method was called.
assert mock_rpc.call_count == 1

# Operation methods build a cached wrapper on first rpc call
# subsequent calls should use the cached wrapper
# Operation methods call wrapper_fn to build a cached
# client._transport.operations_client instance on first rpc call.
# Subsequent calls should use the cached wrapper
wrapper_fn.reset_mock()

client.batch_optimize_tours(request)
Expand Down Expand Up @@ -1627,26 +1629,28 @@ async def test_batch_optimize_tours_async_use_cached_wrapped_rpc(
)

# Replace cached wrapped function with mock
mock_object = mock.AsyncMock()
mock_rpc = mock.AsyncMock()
mock_rpc.return_value = mock.Mock()
client._client._transport._wrapped_methods[
client._client._transport.batch_optimize_tours
] = mock_object
] = mock_rpc

request = {}
await client.batch_optimize_tours(request)

# Establish that the underlying gRPC stub method was called.
assert mock_object.call_count == 1
assert mock_rpc.call_count == 1

# Operation methods build a cached wrapper on first rpc call
# subsequent calls should use the cached wrapper
# Operation methods call wrapper_fn to build a cached
# client._transport.operations_client instance on first rpc call.
# Subsequent calls should use the cached wrapper
wrapper_fn.reset_mock()

await client.batch_optimize_tours(request)

# Establish that a new wrapper was not created for this call
assert wrapper_fn.call_count == 0
assert mock_object.call_count == 2
assert mock_rpc.call_count == 2


@pytest.mark.asyncio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.6.10" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.6.10" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# limitations under the License.
#
from collections import OrderedDict
import functools
import re
from typing import (
AsyncIterable,
Expand Down Expand Up @@ -184,9 +183,7 @@ def universe_domain(self) -> str:
"""
return self._client._universe_domain

get_transport_class = functools.partial(
type(RoutesClient).get_transport_class, type(RoutesClient)
)
get_transport_class = RoutesClient.get_transport_class

def __init__(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ def __init__(
transport_init: Union[
Type[RoutesTransport], Callable[..., RoutesTransport]
] = (
type(self).get_transport_class(transport)
RoutesClient.get_transport_class(transport)
if isinstance(transport, str) or transport is None
else cast(Callable[..., RoutesTransport], transport)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ class TollPass(proto.Enum):
E-card provided by multiple banks used to pay
for tolls. All e-cards via banks are charged the
same so only one enum value is needed. E.g.

- Bank Mandiri
https://www.bankmandiri.co.id/e-money
- BCA https://www.bca.co.id/flazz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-maps-routing",
"version": "0.6.10"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Loading