Skip to content

Ty method name #2651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/mock_vws/_requests_mock_server/mock_web_query_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import email.utils
from collections.abc import Callable, Iterable, Mapping
from http import HTTPMethod, HTTPStatus
from types import MethodType

from beartype import beartype
from requests.models import PreparedRequest
Expand Down Expand Up @@ -52,8 +53,9 @@ def decorator(
The given `method` with multiple changes, including added
validators.
"""
route_name = method.__name__ if isinstance(method, MethodType) else ""
new_route = Route(
route_name=method.__name__,
route_name=route_name,
path_pattern=path_pattern,
http_methods=frozenset(http_methods),
)
Expand Down
4 changes: 3 additions & 1 deletion src/mock_vws/_requests_mock_server/mock_web_services_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import uuid
from collections.abc import Callable, Iterable, Mapping
from http import HTTPMethod, HTTPStatus
from types import MethodType
from typing import Any
from zoneinfo import ZoneInfo

Expand Down Expand Up @@ -67,8 +68,9 @@ def decorator(
The given `method` with multiple changes, including added
validators.
"""
route_name = method.__name__ if isinstance(method, MethodType) else ""
new_route = Route(
route_name=method.__name__,
route_name=route_name,
path_pattern=path_pattern,
http_methods=frozenset(http_methods),
)
Expand Down
Loading