Skip to content

Commit

Permalink
chore: regen related to stabillity in generated code (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored Sep 3, 2020
1 parent e06d879 commit 54fe62e
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 64 deletions.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,22 @@ class ReservationServiceAsyncClient:
DEFAULT_ENDPOINT = ReservationServiceClient.DEFAULT_ENDPOINT
DEFAULT_MTLS_ENDPOINT = ReservationServiceClient.DEFAULT_MTLS_ENDPOINT

assignment_path = staticmethod(ReservationServiceClient.assignment_path)
parse_assignment_path = staticmethod(ReservationServiceClient.parse_assignment_path)
bi_reservation_path = staticmethod(ReservationServiceClient.bi_reservation_path)

parse_bi_reservation_path = staticmethod(
ReservationServiceClient.parse_bi_reservation_path
)
capacity_commitment_path = staticmethod(
ReservationServiceClient.capacity_commitment_path
)

assignment_path = staticmethod(ReservationServiceClient.assignment_path)

parse_capacity_commitment_path = staticmethod(
ReservationServiceClient.parse_capacity_commitment_path
)
reservation_path = staticmethod(ReservationServiceClient.reservation_path)
parse_reservation_path = staticmethod(
ReservationServiceClient.parse_reservation_path
)

from_service_account_file = ReservationServiceClient.from_service_account_file
from_service_account_json = from_service_account_file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import typing
import pkg_resources

from google import auth
from google import auth # type: ignore
from google.api_core import exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
Expand Down
92 changes: 89 additions & 3 deletions packages/google-cloud-bigquery-reservation/synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/python-bigquery-reservation.git",
"sha": "50c85777ae70735fb06c8a7a1b0d6a82a28766c3"
"sha": "1136cae5bf131f9e6aa54aa081416f7f0848eba1"
}
},
{
Expand All @@ -19,14 +19,14 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "d3049e66447b44dc10579e461d5e08e0e3838edd"
"sha": "d91dd8aac77f7a9c5506c238038a26fa4f9e361e"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "d3049e66447b44dc10579e461d5e08e0e3838edd"
"sha": "d91dd8aac77f7a9c5506c238038a26fa4f9e361e"
}
}
],
Expand All @@ -40,5 +40,91 @@
"generator": "gapic-generator-python"
}
}
],
"generatedFiles": [
".coveragerc",
".flake8",
".github/CONTRIBUTING.md",
".github/ISSUE_TEMPLATE/bug_report.md",
".github/ISSUE_TEMPLATE/feature_request.md",
".github/ISSUE_TEMPLATE/support_request.md",
".github/PULL_REQUEST_TEMPLATE.md",
".github/release-please.yml",
".github/snippet-bot.yml",
".gitignore",
".kokoro/build.sh",
".kokoro/continuous/common.cfg",
".kokoro/continuous/continuous.cfg",
".kokoro/docker/docs/Dockerfile",
".kokoro/docker/docs/fetch_gpg_keys.sh",
".kokoro/docs/common.cfg",
".kokoro/docs/docs-presubmit.cfg",
".kokoro/docs/docs.cfg",
".kokoro/presubmit/common.cfg",
".kokoro/presubmit/presubmit.cfg",
".kokoro/publish-docs.sh",
".kokoro/release.sh",
".kokoro/release/common.cfg",
".kokoro/release/release.cfg",
".kokoro/samples/lint/common.cfg",
".kokoro/samples/lint/continuous.cfg",
".kokoro/samples/lint/periodic.cfg",
".kokoro/samples/lint/presubmit.cfg",
".kokoro/samples/python3.6/common.cfg",
".kokoro/samples/python3.6/continuous.cfg",
".kokoro/samples/python3.6/periodic.cfg",
".kokoro/samples/python3.6/presubmit.cfg",
".kokoro/samples/python3.7/common.cfg",
".kokoro/samples/python3.7/continuous.cfg",
".kokoro/samples/python3.7/periodic.cfg",
".kokoro/samples/python3.7/presubmit.cfg",
".kokoro/samples/python3.8/common.cfg",
".kokoro/samples/python3.8/continuous.cfg",
".kokoro/samples/python3.8/periodic.cfg",
".kokoro/samples/python3.8/presubmit.cfg",
".kokoro/test-samples.sh",
".kokoro/trampoline.sh",
".kokoro/trampoline_v2.sh",
".trampolinerc",
"CODE_OF_CONDUCT.md",
"CONTRIBUTING.rst",
"LICENSE",
"MANIFEST.in",
"docs/_static/custom.css",
"docs/_templates/layout.html",
"docs/conf.py",
"docs/multiprocessing.rst",
"docs/reservation_v1/services.rst",
"docs/reservation_v1/types.rst",
"google/cloud/bigquery/reservation/__init__.py",
"google/cloud/bigquery/reservation/py.typed",
"google/cloud/bigquery/reservation_v1/__init__.py",
"google/cloud/bigquery/reservation_v1/py.typed",
"google/cloud/bigquery/reservation_v1/services/__init__.py",
"google/cloud/bigquery/reservation_v1/services/reservation_service/__init__.py",
"google/cloud/bigquery/reservation_v1/services/reservation_service/async_client.py",
"google/cloud/bigquery/reservation_v1/services/reservation_service/client.py",
"google/cloud/bigquery/reservation_v1/services/reservation_service/pagers.py",
"google/cloud/bigquery/reservation_v1/services/reservation_service/transports/__init__.py",
"google/cloud/bigquery/reservation_v1/services/reservation_service/transports/base.py",
"google/cloud/bigquery/reservation_v1/services/reservation_service/transports/grpc.py",
"google/cloud/bigquery/reservation_v1/services/reservation_service/transports/grpc_asyncio.py",
"google/cloud/bigquery/reservation_v1/types/__init__.py",
"google/cloud/bigquery/reservation_v1/types/reservation.py",
"mypy.ini",
"noxfile.py",
"renovate.json",
"scripts/decrypt-secrets.sh",
"scripts/fixup_reservation_v1_keywords.py",
"scripts/readme-gen/readme_gen.py",
"scripts/readme-gen/templates/README.tmpl.rst",
"scripts/readme-gen/templates/auth.tmpl.rst",
"scripts/readme-gen/templates/auth_api_key.tmpl.rst",
"scripts/readme-gen/templates/install_deps.tmpl.rst",
"scripts/readme-gen/templates/install_portaudio.tmpl.rst",
"setup.cfg",
"testing/.gitignore",
"tests/unit/gapic/reservation_v1/__init__.py",
"tests/unit/gapic/reservation_v1/test_reservation_service.py"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -883,8 +883,8 @@ def test_list_reservations_pages():
RuntimeError,
)
pages = list(client.list_reservations(request={}).pages)
for page, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page.raw_page.next_page_token == token
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token


@pytest.mark.asyncio
Expand Down Expand Up @@ -964,10 +964,10 @@ async def test_list_reservations_async_pages():
RuntimeError,
)
pages = []
async for page in (await client.list_reservations(request={})).pages:
pages.append(page)
for page, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page.raw_page.next_page_token == token
async for page_ in (await client.list_reservations(request={})).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token


def test_get_reservation(
Expand Down Expand Up @@ -2130,8 +2130,8 @@ def test_list_capacity_commitments_pages():
RuntimeError,
)
pages = list(client.list_capacity_commitments(request={}).pages)
for page, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page.raw_page.next_page_token == token
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token


@pytest.mark.asyncio
Expand Down Expand Up @@ -2219,10 +2219,10 @@ async def test_list_capacity_commitments_async_pages():
RuntimeError,
)
pages = []
async for page in (await client.list_capacity_commitments(request={})).pages:
pages.append(page)
for page, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page.raw_page.next_page_token == token
async for page_ in (await client.list_capacity_commitments(request={})).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token


def test_get_capacity_commitment(
Expand Down Expand Up @@ -3857,8 +3857,8 @@ def test_list_assignments_pages():
RuntimeError,
)
pages = list(client.list_assignments(request={}).pages)
for page, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page.raw_page.next_page_token == token
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token


@pytest.mark.asyncio
Expand Down Expand Up @@ -3934,10 +3934,10 @@ async def test_list_assignments_async_pages():
RuntimeError,
)
pages = []
async for page in (await client.list_assignments(request={})).pages:
pages.append(page)
for page, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page.raw_page.next_page_token == token
async for page_ in (await client.list_assignments(request={})).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token


def test_delete_assignment(
Expand Down Expand Up @@ -4419,8 +4419,8 @@ def test_search_assignments_pages():
RuntimeError,
)
pages = list(client.search_assignments(request={}).pages)
for page, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page.raw_page.next_page_token == token
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token


@pytest.mark.asyncio
Expand Down Expand Up @@ -4500,10 +4500,10 @@ async def test_search_assignments_async_pages():
RuntimeError,
)
pages = []
async for page in (await client.search_assignments(request={})).pages:
pages.append(page)
for page, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page.raw_page.next_page_token == token
async for page_ in (await client.search_assignments(request={})).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token


def test_move_assignment(
Expand Down Expand Up @@ -5535,6 +5535,38 @@ def test_reservation_service_grpc_asyncio_transport_channel_mtls_with_adc(
assert transport.grpc_channel == mock_grpc_channel


def test_assignment_path():
project = "squid"
location = "clam"
reservation = "whelk"
assignment = "octopus"

expected = "projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}".format(
project=project,
location=location,
reservation=reservation,
assignment=assignment,
)
actual = ReservationServiceClient.assignment_path(
project, location, reservation, assignment
)
assert expected == actual


def test_parse_assignment_path():
expected = {
"project": "oyster",
"location": "nudibranch",
"reservation": "cuttlefish",
"assignment": "mussel",
}
path = ReservationServiceClient.assignment_path(**expected)

# Check that the path construction is reversible.
actual = ReservationServiceClient.parse_assignment_path(path)
assert expected == actual


def test_bi_reservation_path():
project = "squid"
location = "clam"
Expand Down Expand Up @@ -5585,38 +5617,6 @@ def test_parse_capacity_commitment_path():
assert expected == actual


def test_assignment_path():
project = "squid"
location = "clam"
reservation = "whelk"
assignment = "octopus"

expected = "projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}".format(
project=project,
location=location,
reservation=reservation,
assignment=assignment,
)
actual = ReservationServiceClient.assignment_path(
project, location, reservation, assignment
)
assert expected == actual


def test_parse_assignment_path():
expected = {
"project": "oyster",
"location": "nudibranch",
"reservation": "cuttlefish",
"assignment": "mussel",
}
path = ReservationServiceClient.assignment_path(**expected)

# Check that the path construction is reversible.
actual = ReservationServiceClient.parse_assignment_path(path)
assert expected == actual


def test_reservation_path():
project = "squid"
location = "clam"
Expand Down

0 comments on commit 54fe62e

Please sign in to comment.