# Path: google/api_core/path_template.py
# _VARIABLE_RE = re.compile(
#     r"""
#     (  # Capture the entire variable expression
#         (?P<positional>\*\*?)  # Match & capture * and ** positional variables.
#         |
#         # Match & capture named variables {name}
#         {
#             (?P<name>[^/]+?)
#             # Optionally match and capture the named variable's template.
#             (?:=(?P<template>.+?))?
#         }
#     )
#     """,
#     re.VERBOSE,
# )
# _SINGLE_SEGMENT_PATTERN = r"([^/]+)"
# _MULTI_SEGMENT_PATTERN = r"(.+)"
# def _expand_variable_match(positional_vars, named_vars, match):
# def expand(tmpl, *args, **kwargs):
# def _replace_variable_with_pattern(match):
# def _generate_pattern_for_template(tmpl):
# def get_field(request, field):
# def delete_field(request, field):
# def validate(tmpl, path):
# def transcode(http_options, **request_kwargs):


import mock
import pytest
from google.api_core import path_template
                "data": {"id": 1, "info": "some info"},
                "foo": "bar",
            },
            [
                "post",
                "/v1/a/parent/b/first/last",
                {"id": 1, "info": "some info"},
                {"foo": "bar"},
            ],
        ],
        # Wildcard body
        [
            [["post", "/v1/{field=a/*}/b/{name=**}", "*"]],
            {
                "field": "a/parent",
                "name": "first/last",
                "data": {"id": 1, "info": "some info"},
                "foo": "bar",
            },
            [
                "post",
                "/v1/a/parent/b/first/last",
                {"data": {"id": 1, "info": "some info"}, "foo": "bar"},
                {},
            ],
        ],
    ],
)
def test_transcode_with_body(http_options, request_kwargs, expected_result):
    http_options, expected_result = helper_test_transcode(http_options, expected_result)

# Path: google/api_core/path_template.py
# _VARIABLE_RE = re.compile(
#     r"""
#     (  # Capture the entire variable expression
#         (?P<positional>\*\*?)  # Match & capture * and ** positional variables.
#         |
#         # Match & capture named variables {name}
#         {
#             (?P<name>[^/]+?)
#             # Optionally match and capture the named variable's template.
#             (?:=(?P<template>.+?))?
#         }
#     )
#     """,
#     re.VERBOSE,
# )
# _SINGLE_SEGMENT_PATTERN = r"([^/]+)"
# _MULTI_SEGMENT_PATTERN = r"(.+)"
# def _expand_variable_match(positional_vars, named_vars, match):
# def expand(tmpl, *args, **kwargs):
# def _replace_variable_with_pattern(match):
# def _generate_pattern_for_template(tmpl):
# def get_field(request, field):
# def delete_field(request, field):
# def validate(tmpl, path):
# def transcode(http_options, **request_kwargs):


# Path: tests/unit/test_path_template.py
import mock
import pytest
from google.api_core import path_template

                "data": {"id": 1, "info": "some info"},
                "foo": "bar",
            },
            [
                "post",
                "/v1/a/parent/b/first/last",
                {"id": 1, "info": "some info"},
                {"foo": "bar"},
            ],
        ],
        # Wildcard body
        [
            [["post", "/v1/{field=a/*}/b/{name=**}", "*"]],
            {
                "field": "a/parent",
                "name": "first/last",
                "data": {"id": 1, "info": "some info"},
                "foo": "bar",
            },
            [
                "post",
                "/v1/a/parent/b/first/last",
                {"data": {"id": 1, "info": "some info"}, "foo": "bar"},
                {},
            ],
        ],
    ],
)
def test_transcode_with_body(http_options, request_kwargs, expected_result):
    http_options, expected_result = helper_test_transcode(http_options, expected_result)

    result = path_template.transcode(http_options, **request_kwargs)