Skip to content

Commit 33741f8

Browse files
committed
fixed lint
1 parent 3384473 commit 33741f8

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

packages/google-api-core/google/api_core/path_template.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ def _build_capture_pattern(template_str: str) -> tuple[re.Pattern, tuple[str, ..
134134

135135
def replacer(match):
136136
positional = match.group("positional")
137-
name = match.group("name")
138137
template = match.group("template")
139138

140139
if positional == "*":

packages/google-api-core/tests/unit/test_path_template.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,14 +795,21 @@ def test_percent_encoding_unreserved_characters(tmpl, kwargs, expected_result):
795795
("/v1/{name=**}", [], {"name": ".."}, r"Invalid value .* for name\."),
796796
],
797797
)
798-
def test_path_traversal_dots_validation_bare_double_star(tmpl, args, kwargs, expected_err_match):
798+
def test_path_traversal_dots_validation_bare_double_star(
799+
tmpl, args, kwargs, expected_err_match
800+
):
799801
with pytest.raises(ValueError, match=expected_err_match):
800802
path_template.expand(tmpl, *args, **kwargs)
801803

804+
802805
@pytest.mark.parametrize(
803806
"template_str, expected_pattern, expected_wildcards",
804807
[
805-
("projects/{project}/locations/{location}", "projects/([^/]+)/locations/([^/]+)", ("*", "*")),
808+
(
809+
"projects/{project}/locations/{location}",
810+
"projects/([^/]+)/locations/([^/]+)",
811+
("*", "*"),
812+
),
806813
("projects/{project=**}", "projects/(.+)", ("**",)),
807814
("projects/{project=locations/*}", "projects/locations/([^/]+)", ("*",)),
808815
("projects/*/locations/**", "projects/([^/]+)/locations/(.+)", ("*", "**")),

0 commit comments

Comments
 (0)