Skip to content

Commit

Permalink
fix: update repo name
Browse files Browse the repository at this point in the history
java-memcache set for all accidentally

Source-Author: Emily Ball <emilyball@google.com>
Source-Date: Thu Feb 4 10:39:41 2021 -0800
Source-Repo: googleapis/synthtool
Source-Sha: 692715c0f23a7bb3bfbbaa300f7620ddfa8c47e5
Source-Link: googleapis/synthtool@692715c
  • Loading branch information
yoshi-automation committed May 30, 2021
1 parent 60a37d1 commit d169fd5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,32 +196,32 @@ def parse_dataset_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def dataset_path(project: str, location: str, dataset: str,) -> str:
def dataset_path(project: str, dataset: str,) -> str:
"""Return a fully-qualified dataset string."""
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
project=project, location=location, dataset=dataset,
return "projects/{project}/datasets/{dataset}".format(
project=project, dataset=dataset,
)

@staticmethod
def parse_dataset_path(path: str) -> Dict[str, str]:
"""Parse a dataset path into its component segments."""
m = re.match(
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
path,
)
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
return m.groupdict() if m else {}

@staticmethod
def dataset_path(project: str, dataset: str,) -> str:
def dataset_path(project: str, location: str, dataset: str,) -> str:
"""Return a fully-qualified dataset string."""
return "projects/{project}/datasets/{dataset}".format(
project=project, dataset=dataset,
return "projects/{project}/locations/{location}/datasets/{dataset}".format(
project=project, location=location, dataset=dataset,
)

@staticmethod
def parse_dataset_path(path: str) -> Dict[str, str]:
"""Parse a dataset path into its component segments."""
m = re.match(r"^projects/(?P<project>.+?)/datasets/(?P<dataset>.+?)$", path)
m = re.match(
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)$",
path,
)
return m.groupdict() if m else {}

@staticmethod
Expand Down
28 changes: 14 additions & 14 deletions tests/unit/gapic/aiplatform_v1beta1/test_migration_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1534,21 +1534,19 @@ def test_parse_dataset_path():

def test_dataset_path():
project = "squid"
location = "clam"
dataset = "whelk"
dataset = "clam"

expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
project=project, location=location, dataset=dataset,
expected = "projects/{project}/datasets/{dataset}".format(
project=project, dataset=dataset,
)
actual = MigrationServiceClient.dataset_path(project, location, dataset)
actual = MigrationServiceClient.dataset_path(project, dataset)
assert expected == actual


def test_parse_dataset_path():
expected = {
"project": "octopus",
"location": "oyster",
"dataset": "nudibranch",
"project": "whelk",
"dataset": "octopus",
}
path = MigrationServiceClient.dataset_path(**expected)

Expand All @@ -1558,19 +1556,21 @@ def test_parse_dataset_path():


def test_dataset_path():
project = "cuttlefish"
dataset = "mussel"
project = "oyster"
location = "nudibranch"
dataset = "cuttlefish"

expected = "projects/{project}/datasets/{dataset}".format(
project=project, dataset=dataset,
expected = "projects/{project}/locations/{location}/datasets/{dataset}".format(
project=project, location=location, dataset=dataset,
)
actual = MigrationServiceClient.dataset_path(project, dataset)
actual = MigrationServiceClient.dataset_path(project, location, dataset)
assert expected == actual


def test_parse_dataset_path():
expected = {
"project": "winkle",
"project": "mussel",
"location": "winkle",
"dataset": "nautilus",
}
path = MigrationServiceClient.dataset_path(**expected)
Expand Down

0 comments on commit d169fd5

Please sign in to comment.