From b2f60d568a90b614c6404cc4ba566c850626969e Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 31 Jul 2020 08:20:53 -0700 Subject: [PATCH] fix: remove all dependencies on sloth * fix: remove all dependencies on sloth Also, move code that was copied and pasted twice into a common py file. fixes https://github.com/googleapis/synthtool/issues/645 * fix import path to list_split_repositories * consider a repo with most of its code written in Javascript or Typescript to be a nodejs repo and see if it has a synth.py file * remove obsolete addendum files * when querying a repo's language, ignore languages we don't care about like Shell * ignore archived repos Source-Author: Jeffrey Rennie Source-Date: Fri Jun 26 14:59:14 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: d79dc99519468f365c51210436ad277757d12844 Source-Link: https://github.com/googleapis/synthtool/commit/d79dc99519468f365c51210436ad277757d12844 --- .../reservation_service/async_client.py | 8 +- synth.metadata | 4 +- .../test_reservation_service.py | 98 +++++++++---------- 3 files changed, 55 insertions(+), 55 deletions(-) diff --git a/google/cloud/bigquery/reservation_v1/services/reservation_service/async_client.py b/google/cloud/bigquery/reservation_v1/services/reservation_service/async_client.py index 186105d9..29bbf3f6 100644 --- a/google/cloud/bigquery/reservation_v1/services/reservation_service/async_client.py +++ b/google/cloud/bigquery/reservation_v1/services/reservation_service/async_client.py @@ -65,15 +65,15 @@ class ReservationServiceAsyncClient: DEFAULT_ENDPOINT = ReservationServiceClient.DEFAULT_ENDPOINT DEFAULT_MTLS_ENDPOINT = ReservationServiceClient.DEFAULT_MTLS_ENDPOINT - reservation_path = staticmethod(ReservationServiceClient.reservation_path) + bi_reservation_path = staticmethod(ReservationServiceClient.bi_reservation_path) + + assignment_path = staticmethod(ReservationServiceClient.assignment_path) capacity_commitment_path = staticmethod( ReservationServiceClient.capacity_commitment_path ) - bi_reservation_path = staticmethod(ReservationServiceClient.bi_reservation_path) - - assignment_path = staticmethod(ReservationServiceClient.assignment_path) + reservation_path = staticmethod(ReservationServiceClient.reservation_path) from_service_account_file = ReservationServiceClient.from_service_account_file from_service_account_json = from_service_account_file diff --git a/synth.metadata b/synth.metadata index 803fc01d..457848e0 100644 --- a/synth.metadata +++ b/synth.metadata @@ -19,14 +19,14 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "652d446edabb0ea07de0ce542c6b37ab7dad3a19" + "sha": "d79dc99519468f365c51210436ad277757d12844" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "652d446edabb0ea07de0ce542c6b37ab7dad3a19" + "sha": "d79dc99519468f365c51210436ad277757d12844" } } ], diff --git a/tests/unit/gapic/reservation_v1/test_reservation_service.py b/tests/unit/gapic/reservation_v1/test_reservation_service.py index 9d2b80d8..61164f62 100644 --- a/tests/unit/gapic/reservation_v1/test_reservation_service.py +++ b/tests/unit/gapic/reservation_v1/test_reservation_service.py @@ -5525,108 +5525,108 @@ def test_reservation_service_grpc_asyncio_transport_channel_mtls_with_adc( assert transport.grpc_channel == mock_grpc_channel -def test_reservation_path(): +def test_bi_reservation_path(): project = "squid" location = "clam" - reservation = "whelk" - expected = "projects/{project}/locations/{location}/reservations/{reservation}".format( - project=project, location=location, reservation=reservation, + expected = "projects/{project}/locations/{location}/bireservation".format( + project=project, location=location, ) - actual = ReservationServiceClient.reservation_path(project, location, reservation) + actual = ReservationServiceClient.bi_reservation_path(project, location) assert expected == actual -def test_parse_reservation_path(): +def test_parse_bi_reservation_path(): expected = { - "project": "octopus", - "location": "oyster", - "reservation": "nudibranch", + "project": "whelk", + "location": "octopus", } - path = ReservationServiceClient.reservation_path(**expected) + path = ReservationServiceClient.bi_reservation_path(**expected) # Check that the path construction is reversible. - actual = ReservationServiceClient.parse_reservation_path(path) + actual = ReservationServiceClient.parse_bi_reservation_path(path) assert expected == actual -def test_capacity_commitment_path(): +def test_assignment_path(): project = "squid" location = "clam" - capacity_commitment = "whelk" + reservation = "whelk" + assignment = "octopus" - expected = "projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}".format( - project=project, location=location, capacity_commitment=capacity_commitment, + expected = "projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}".format( + project=project, + location=location, + reservation=reservation, + assignment=assignment, ) - actual = ReservationServiceClient.capacity_commitment_path( - project, location, capacity_commitment + actual = ReservationServiceClient.assignment_path( + project, location, reservation, assignment ) assert expected == actual -def test_parse_capacity_commitment_path(): +def test_parse_assignment_path(): expected = { - "project": "octopus", - "location": "oyster", - "capacity_commitment": "nudibranch", + "project": "oyster", + "location": "nudibranch", + "reservation": "cuttlefish", + "assignment": "mussel", } - path = ReservationServiceClient.capacity_commitment_path(**expected) + path = ReservationServiceClient.assignment_path(**expected) # Check that the path construction is reversible. - actual = ReservationServiceClient.parse_capacity_commitment_path(path) + actual = ReservationServiceClient.parse_assignment_path(path) assert expected == actual -def test_bi_reservation_path(): +def test_capacity_commitment_path(): project = "squid" location = "clam" + capacity_commitment = "whelk" - expected = "projects/{project}/locations/{location}/bireservation".format( - project=project, location=location, + expected = "projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}".format( + project=project, location=location, capacity_commitment=capacity_commitment, + ) + actual = ReservationServiceClient.capacity_commitment_path( + project, location, capacity_commitment ) - actual = ReservationServiceClient.bi_reservation_path(project, location) assert expected == actual -def test_parse_bi_reservation_path(): +def test_parse_capacity_commitment_path(): expected = { - "project": "whelk", - "location": "octopus", + "project": "octopus", + "location": "oyster", + "capacity_commitment": "nudibranch", } - path = ReservationServiceClient.bi_reservation_path(**expected) + path = ReservationServiceClient.capacity_commitment_path(**expected) # Check that the path construction is reversible. - actual = ReservationServiceClient.parse_bi_reservation_path(path) + actual = ReservationServiceClient.parse_capacity_commitment_path(path) assert expected == actual -def test_assignment_path(): +def test_reservation_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 + expected = "projects/{project}/locations/{location}/reservations/{reservation}".format( + project=project, location=location, reservation=reservation, ) + actual = ReservationServiceClient.reservation_path(project, location, reservation) assert expected == actual -def test_parse_assignment_path(): +def test_parse_reservation_path(): expected = { - "project": "oyster", - "location": "nudibranch", - "reservation": "cuttlefish", - "assignment": "mussel", + "project": "octopus", + "location": "oyster", + "reservation": "nudibranch", } - path = ReservationServiceClient.assignment_path(**expected) + path = ReservationServiceClient.reservation_path(**expected) # Check that the path construction is reversible. - actual = ReservationServiceClient.parse_assignment_path(path) + actual = ReservationServiceClient.parse_reservation_path(path) assert expected == actual