Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
fix: remove all dependencies on sloth
Browse files Browse the repository at this point in the history
* fix: remove all dependencies on sloth

Also, move code that was copied and pasted twice into a common py file.

fixes googleapis/synthtool#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 <rennie@google.com>
Source-Date: Fri Jun 26 14:59:14 2020 -0700
Source-Repo: googleapis/synthtool
Source-Sha: d79dc99519468f365c51210436ad277757d12844
Source-Link: googleapis/synthtool@d79dc99
  • Loading branch information
yoshi-automation committed Jul 31, 2020
1 parent 37f6559 commit b2f60d5
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
],
Expand Down
98 changes: 49 additions & 49 deletions tests/unit/gapic/reservation_v1/test_reservation_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b2f60d5

Please sign in to comment.