diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e14395a..50228f60 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,14 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'stl-preview-head/**' - - 'stl-preview-base/**' + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: branches-ignore: - 'stl-preview-head/**' diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 347a18e5..800156fe 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.24.1" + ".": "1.24.2" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a8492e0f..9b190d9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## 1.24.2 (2026-03-20) + +Full Changelog: [v1.24.1...v1.24.2](https://github.com/knocklabs/knock-python/compare/v1.24.1...v1.24.2) + +### Bug Fixes + +* **deps:** bump minimum typing-extensions version ([3faab94](https://github.com/knocklabs/knock-python/commit/3faab948d5ae4297d7c35150545d843e0c34f427)) +* sanitize endpoint path params ([5615d9e](https://github.com/knocklabs/knock-python/commit/5615d9e295147ff3a2321ca06222d2f04c875e30)) + + +### Chores + +* **internal:** tweak CI branches ([4c01647](https://github.com/knocklabs/knock-python/commit/4c016474b315185a18ec577ea79e0b3115607dd3)) +* **tests:** bump steady to v0.19.4 ([1b211c0](https://github.com/knocklabs/knock-python/commit/1b211c0a547eff991969ddfb57418b9797cb5f10)) +* **tests:** bump steady to v0.19.5 ([a0638b5](https://github.com/knocklabs/knock-python/commit/a0638b570e32ab0db5028d1e5ab4f24da80bee7b)) + + +### Refactors + +* **tests:** switch from prism to steady ([29d5c77](https://github.com/knocklabs/knock-python/commit/29d5c776dae1ed8712a0d5514f48ee0fe6afda14)) + ## 1.24.1 (2026-03-16) Full Changelog: [v1.24.0...v1.24.1](https://github.com/knocklabs/knock-python/compare/v1.24.0...v1.24.1) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e12d6933..46ce97dc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -85,7 +85,7 @@ $ pip install ./path-to-wheel-file.whl ## Running tests -Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. +Most tests require you to [set up a mock server](https://github.com/dgellow/steady) against the OpenAPI spec to run the tests. ```sh $ ./scripts/mock diff --git a/pyproject.toml b/pyproject.toml index 9e40cd66..ddfacac1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "knockapi" -version = "1.24.1" +version = "1.24.2" description = "The official Python library for the knock API" dynamic = ["readme"] license = "Apache-2.0" @@ -11,7 +11,7 @@ authors = [ dependencies = [ "httpx>=0.23.0, <1", "pydantic>=1.9.0, <3", - "typing-extensions>=4.10, <5", + "typing-extensions>=4.14, <5", "anyio>=3.5.0, <5", "distro>=1.7.0, <2", "sniffio", diff --git a/scripts/mock b/scripts/mock index bcf3b392..4f7dfd12 100755 --- a/scripts/mock +++ b/scripts/mock @@ -19,34 +19,34 @@ fi echo "==> Starting mock server with URL ${URL}" -# Run prism mock on the given spec +# Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism --version + npm exec --package=@stdy/cli@0.19.5 -- steady --version - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & - # Wait for server to come online (max 30s) + # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" attempts=0 - while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do + if ! kill -0 $! 2>/dev/null; then + echo + cat .stdy.log + exit 1 + fi attempts=$((attempts + 1)) if [ "$attempts" -ge 300 ]; then echo - echo "Timed out waiting for Prism server to start" - cat .prism.log + echo "Timed out waiting for Steady server to start" + cat .stdy.log exit 1 fi echo -n "." sleep 0.1 done - if grep -q "✖ fatal" ".prism.log"; then - cat .prism.log - exit 1 - fi - echo else - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" + npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index dbeda2d2..3861edc6 100755 --- a/scripts/test +++ b/scripts/test @@ -9,8 +9,8 @@ GREEN='\033[0;32m' YELLOW='\033[0;33m' NC='\033[0m' # No Color -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 +function steady_is_running() { + curl --silent "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1 } kill_server_on_port() { @@ -25,7 +25,7 @@ function is_overriding_api_base_url() { [ -n "$TEST_API_BASE_URL" ] } -if ! is_overriding_api_base_url && ! prism_is_running ; then +if ! is_overriding_api_base_url && ! steady_is_running ; then # When we exit this script, make sure to kill the background mock server process trap 'kill_server_on_port 4010' EXIT @@ -36,19 +36,19 @@ fi if is_overriding_api_base_url ; then echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" echo -elif ! prism_is_running ; then - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" +elif ! steady_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Steady server" echo -e "running against your OpenAPI spec." echo echo -e "To run the server, pass in the path or url of your OpenAPI" - echo -e "spec to the prism command:" + echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.5 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=brackets --validator-query-array-format=brackets --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 else - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo -e "${GREEN}✔ Mock steady server is running with your OpenAPI spec${NC}" echo fi diff --git a/src/knockapi/_utils/__init__.py b/src/knockapi/_utils/__init__.py index dc64e29a..10cb66d2 100644 --- a/src/knockapi/_utils/__init__.py +++ b/src/knockapi/_utils/__init__.py @@ -1,3 +1,4 @@ +from ._path import path_template as path_template from ._sync import asyncify as asyncify from ._proxy import LazyProxy as LazyProxy from ._utils import ( diff --git a/src/knockapi/_utils/_path.py b/src/knockapi/_utils/_path.py new file mode 100644 index 00000000..4d6e1e4c --- /dev/null +++ b/src/knockapi/_utils/_path.py @@ -0,0 +1,127 @@ +from __future__ import annotations + +import re +from typing import ( + Any, + Mapping, + Callable, +) +from urllib.parse import quote + +# Matches '.' or '..' where each dot is either literal or percent-encoded (%2e / %2E). +_DOT_SEGMENT_RE = re.compile(r"^(?:\.|%2[eE]){1,2}$") + +_PLACEHOLDER_RE = re.compile(r"\{(\w+)\}") + + +def _quote_path_segment_part(value: str) -> str: + """Percent-encode `value` for use in a URI path segment. + + Considers characters not in `pchar` set from RFC 3986 §3.3 to be unsafe. + https://datatracker.ietf.org/doc/html/rfc3986#section-3.3 + """ + # quote() already treats unreserved characters (letters, digits, and -._~) + # as safe, so we only need to add sub-delims, ':', and '@'. + # Notably, unlike the default `safe` for quote(), / is unsafe and must be quoted. + return quote(value, safe="!$&'()*+,;=:@") + + +def _quote_query_part(value: str) -> str: + """Percent-encode `value` for use in a URI query string. + + Considers &, = and characters not in `query` set from RFC 3986 §3.4 to be unsafe. + https://datatracker.ietf.org/doc/html/rfc3986#section-3.4 + """ + return quote(value, safe="!$'()*+,;:@/?") + + +def _quote_fragment_part(value: str) -> str: + """Percent-encode `value` for use in a URI fragment. + + Considers characters not in `fragment` set from RFC 3986 §3.5 to be unsafe. + https://datatracker.ietf.org/doc/html/rfc3986#section-3.5 + """ + return quote(value, safe="!$&'()*+,;=:@/?") + + +def _interpolate( + template: str, + values: Mapping[str, Any], + quoter: Callable[[str], str], +) -> str: + """Replace {name} placeholders in `template`, quoting each value with `quoter`. + + Placeholder names are looked up in `values`. + + Raises: + KeyError: If a placeholder is not found in `values`. + """ + # re.split with a capturing group returns alternating + # [text, name, text, name, ..., text] elements. + parts = _PLACEHOLDER_RE.split(template) + + for i in range(1, len(parts), 2): + name = parts[i] + if name not in values: + raise KeyError(f"a value for placeholder {{{name}}} was not provided") + val = values[name] + if val is None: + parts[i] = "null" + elif isinstance(val, bool): + parts[i] = "true" if val else "false" + else: + parts[i] = quoter(str(values[name])) + + return "".join(parts) + + +def path_template(template: str, /, **kwargs: Any) -> str: + """Interpolate {name} placeholders in `template` from keyword arguments. + + Args: + template: The template string containing {name} placeholders. + **kwargs: Keyword arguments to interpolate into the template. + + Returns: + The template with placeholders interpolated and percent-encoded. + + Safe characters for percent-encoding are dependent on the URI component. + Placeholders in path and fragment portions are percent-encoded where the `segment` + and `fragment` sets from RFC 3986 respectively are considered safe. + Placeholders in the query portion are percent-encoded where the `query` set from + RFC 3986 §3.3 is considered safe except for = and & characters. + + Raises: + KeyError: If a placeholder is not found in `kwargs`. + ValueError: If resulting path contains /./ or /../ segments (including percent-encoded dot-segments). + """ + # Split the template into path, query, and fragment portions. + fragment_template: str | None = None + query_template: str | None = None + + rest = template + if "#" in rest: + rest, fragment_template = rest.split("#", 1) + if "?" in rest: + rest, query_template = rest.split("?", 1) + path_template = rest + + # Interpolate each portion with the appropriate quoting rules. + path_result = _interpolate(path_template, kwargs, _quote_path_segment_part) + + # Reject dot-segments (. and ..) in the final assembled path. The check + # runs after interpolation so that adjacent placeholders or a mix of static + # text and placeholders that together form a dot-segment are caught. + # Also reject percent-encoded dot-segments to protect against incorrectly + # implemented normalization in servers/proxies. + for segment in path_result.split("/"): + if _DOT_SEGMENT_RE.match(segment): + raise ValueError(f"Constructed path {path_result!r} contains dot-segment {segment!r} which is not allowed") + + result = path_result + if query_template is not None: + result += "?" + _interpolate(query_template, kwargs, _quote_query_part) + if fragment_template is not None: + result += "#" + _interpolate(fragment_template, kwargs, _quote_fragment_part) + + return result diff --git a/src/knockapi/_version.py b/src/knockapi/_version.py index b7dec2ee..cf43cf46 100644 --- a/src/knockapi/_version.py +++ b/src/knockapi/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "knockapi" -__version__ = "1.24.1" # x-release-please-version +__version__ = "1.24.2" # x-release-please-version diff --git a/src/knockapi/resources/audiences.py b/src/knockapi/resources/audiences.py index 2ab417d9..f592f67a 100644 --- a/src/knockapi/resources/audiences.py +++ b/src/knockapi/resources/audiences.py @@ -8,7 +8,7 @@ from ..types import audience_add_members_params, audience_remove_members_params from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given -from .._utils import maybe_transform, async_maybe_transform +from .._utils import path_template, maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( @@ -81,7 +81,7 @@ def add_members( raise ValueError(f"Expected a non-empty value for `key` but received {key!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return self._post( - f"/v1/audiences/{key}/members", + path_template("/v1/audiences/{key}/members", key=key), body=maybe_transform({"members": members}, audience_add_members_params.AudienceAddMembersParams), options=make_request_options( extra_headers=extra_headers, @@ -122,7 +122,7 @@ def list_members( if not key: raise ValueError(f"Expected a non-empty value for `key` but received {key!r}") return self._get( - f"/v1/audiences/{key}/members", + path_template("/v1/audiences/{key}/members", key=key), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -163,7 +163,7 @@ def remove_members( raise ValueError(f"Expected a non-empty value for `key` but received {key!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return self._delete( - f"/v1/audiences/{key}/members", + path_template("/v1/audiences/{key}/members", key=key), body=maybe_transform({"members": members}, audience_remove_members_params.AudienceRemoveMembersParams), options=make_request_options( extra_headers=extra_headers, @@ -234,7 +234,7 @@ async def add_members( raise ValueError(f"Expected a non-empty value for `key` but received {key!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return await self._post( - f"/v1/audiences/{key}/members", + path_template("/v1/audiences/{key}/members", key=key), body=await async_maybe_transform( {"members": members}, audience_add_members_params.AudienceAddMembersParams ), @@ -277,7 +277,7 @@ async def list_members( if not key: raise ValueError(f"Expected a non-empty value for `key` but received {key!r}") return await self._get( - f"/v1/audiences/{key}/members", + path_template("/v1/audiences/{key}/members", key=key), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -318,7 +318,7 @@ async def remove_members( raise ValueError(f"Expected a non-empty value for `key` but received {key!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return await self._delete( - f"/v1/audiences/{key}/members", + path_template("/v1/audiences/{key}/members", key=key), body=await async_maybe_transform( {"members": members}, audience_remove_members_params.AudienceRemoveMembersParams ), diff --git a/src/knockapi/resources/bulk_operations.py b/src/knockapi/resources/bulk_operations.py index 1cf6d595..02246ffe 100644 --- a/src/knockapi/resources/bulk_operations.py +++ b/src/knockapi/resources/bulk_operations.py @@ -5,6 +5,7 @@ import httpx from .._types import Body, Query, Headers, NotGiven, not_given +from .._utils import path_template from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( @@ -69,7 +70,7 @@ def get( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get( - f"/v1/bulk_operations/{id}", + path_template("/v1/bulk_operations/{id}", id=id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -127,7 +128,7 @@ async def get( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._get( - f"/v1/bulk_operations/{id}", + path_template("/v1/bulk_operations/{id}", id=id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), diff --git a/src/knockapi/resources/channels/bulk.py b/src/knockapi/resources/channels/bulk.py index db127642..f9658346 100644 --- a/src/knockapi/resources/channels/bulk.py +++ b/src/knockapi/resources/channels/bulk.py @@ -9,7 +9,7 @@ import httpx from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -125,7 +125,7 @@ def update_message_status( if not action: raise ValueError(f"Expected a non-empty value for `action` but received {action!r}") return self._post( - f"/v1/channels/{channel_id}/messages/bulk/{action}", + path_template("/v1/channels/{channel_id}/messages/bulk/{action}", channel_id=channel_id, action=action), body=maybe_transform( { "archived": archived, @@ -252,7 +252,7 @@ async def update_message_status( if not action: raise ValueError(f"Expected a non-empty value for `action` but received {action!r}") return await self._post( - f"/v1/channels/{channel_id}/messages/bulk/{action}", + path_template("/v1/channels/{channel_id}/messages/bulk/{action}", channel_id=channel_id, action=action), body=await async_maybe_transform( { "archived": archived, diff --git a/src/knockapi/resources/messages/messages.py b/src/knockapi/resources/messages/messages.py index 1e6c70c8..daf1ffef 100644 --- a/src/knockapi/resources/messages/messages.py +++ b/src/knockapi/resources/messages/messages.py @@ -23,7 +23,7 @@ message_mark_as_interacted_params, ) from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -202,7 +202,7 @@ def archive( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._put( - f"/v1/messages/{message_id}/archived", + path_template("/v1/messages/{message_id}/archived", message_id=message_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -239,7 +239,7 @@ def get( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._get( - f"/v1/messages/{message_id}", + path_template("/v1/messages/{message_id}", message_id=message_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -273,7 +273,7 @@ def get_content( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._get( - f"/v1/messages/{message_id}/content", + path_template("/v1/messages/{message_id}/content", message_id=message_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -318,7 +318,7 @@ def list_activities( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._get_api_list( - f"/v1/messages/{message_id}/activities", + path_template("/v1/messages/{message_id}/activities", message_id=message_id), page=SyncItemsCursor[Activity], options=make_request_options( extra_headers=extra_headers, @@ -373,7 +373,7 @@ def list_delivery_logs( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._get_api_list( - f"/v1/messages/{message_id}/delivery_logs", + path_template("/v1/messages/{message_id}/delivery_logs", message_id=message_id), page=SyncItemsCursor[MessageDeliveryLog], options=make_request_options( extra_headers=extra_headers, @@ -427,7 +427,7 @@ def list_events( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._get_api_list( - f"/v1/messages/{message_id}/events", + path_template("/v1/messages/{message_id}/events", message_id=message_id), page=SyncItemsCursor[MessageEvent], options=make_request_options( extra_headers=extra_headers, @@ -483,7 +483,7 @@ def mark_as_interacted( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._put( - f"/v1/messages/{message_id}/interacted", + path_template("/v1/messages/{message_id}/interacted", message_id=message_id), body=maybe_transform( {"metadata": metadata}, message_mark_as_interacted_params.MessageMarkAsInteractedParams ), @@ -529,7 +529,7 @@ def mark_as_read( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._put( - f"/v1/messages/{message_id}/read", + path_template("/v1/messages/{message_id}/read", message_id=message_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -572,7 +572,7 @@ def mark_as_seen( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._put( - f"/v1/messages/{message_id}/seen", + path_template("/v1/messages/{message_id}/seen", message_id=message_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -615,7 +615,7 @@ def mark_as_unread( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._delete( - f"/v1/messages/{message_id}/read", + path_template("/v1/messages/{message_id}/read", message_id=message_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -658,7 +658,7 @@ def mark_as_unseen( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._delete( - f"/v1/messages/{message_id}/seen", + path_template("/v1/messages/{message_id}/seen", message_id=message_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -699,7 +699,7 @@ def unarchive( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._delete( - f"/v1/messages/{message_id}/archived", + path_template("/v1/messages/{message_id}/archived", message_id=message_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -870,7 +870,7 @@ async def archive( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return await self._put( - f"/v1/messages/{message_id}/archived", + path_template("/v1/messages/{message_id}/archived", message_id=message_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -907,7 +907,7 @@ async def get( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return await self._get( - f"/v1/messages/{message_id}", + path_template("/v1/messages/{message_id}", message_id=message_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -941,7 +941,7 @@ async def get_content( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return await self._get( - f"/v1/messages/{message_id}/content", + path_template("/v1/messages/{message_id}/content", message_id=message_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -986,7 +986,7 @@ def list_activities( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._get_api_list( - f"/v1/messages/{message_id}/activities", + path_template("/v1/messages/{message_id}/activities", message_id=message_id), page=AsyncItemsCursor[Activity], options=make_request_options( extra_headers=extra_headers, @@ -1041,7 +1041,7 @@ def list_delivery_logs( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._get_api_list( - f"/v1/messages/{message_id}/delivery_logs", + path_template("/v1/messages/{message_id}/delivery_logs", message_id=message_id), page=AsyncItemsCursor[MessageDeliveryLog], options=make_request_options( extra_headers=extra_headers, @@ -1095,7 +1095,7 @@ def list_events( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._get_api_list( - f"/v1/messages/{message_id}/events", + path_template("/v1/messages/{message_id}/events", message_id=message_id), page=AsyncItemsCursor[MessageEvent], options=make_request_options( extra_headers=extra_headers, @@ -1151,7 +1151,7 @@ async def mark_as_interacted( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return await self._put( - f"/v1/messages/{message_id}/interacted", + path_template("/v1/messages/{message_id}/interacted", message_id=message_id), body=await async_maybe_transform( {"metadata": metadata}, message_mark_as_interacted_params.MessageMarkAsInteractedParams ), @@ -1197,7 +1197,7 @@ async def mark_as_read( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return await self._put( - f"/v1/messages/{message_id}/read", + path_template("/v1/messages/{message_id}/read", message_id=message_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1240,7 +1240,7 @@ async def mark_as_seen( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return await self._put( - f"/v1/messages/{message_id}/seen", + path_template("/v1/messages/{message_id}/seen", message_id=message_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1283,7 +1283,7 @@ async def mark_as_unread( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return await self._delete( - f"/v1/messages/{message_id}/read", + path_template("/v1/messages/{message_id}/read", message_id=message_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1326,7 +1326,7 @@ async def mark_as_unseen( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return await self._delete( - f"/v1/messages/{message_id}/seen", + path_template("/v1/messages/{message_id}/seen", message_id=message_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1367,7 +1367,7 @@ async def unarchive( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return await self._delete( - f"/v1/messages/{message_id}/archived", + path_template("/v1/messages/{message_id}/archived", message_id=message_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/knockapi/resources/objects/bulk.py b/src/knockapi/resources/objects/bulk.py index de559248..e19fd411 100644 --- a/src/knockapi/resources/objects/bulk.py +++ b/src/knockapi/resources/objects/bulk.py @@ -7,7 +7,7 @@ import httpx from ..._types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -84,7 +84,7 @@ def delete( if not collection: raise ValueError(f"Expected a non-empty value for `collection` but received {collection!r}") return self._post( - f"/v1/objects/{collection}/bulk/delete", + path_template("/v1/objects/{collection}/bulk/delete", collection=collection), body=maybe_transform({"object_ids": object_ids}, bulk_delete_params.BulkDeleteParams), options=make_request_options( extra_headers=extra_headers, @@ -133,7 +133,7 @@ def add_subscriptions( if not collection: raise ValueError(f"Expected a non-empty value for `collection` but received {collection!r}") return self._post( - f"/v1/objects/{collection}/bulk/subscriptions/add", + path_template("/v1/objects/{collection}/bulk/subscriptions/add", collection=collection), body=maybe_transform( {"subscriptions": subscriptions}, bulk_add_subscriptions_params.BulkAddSubscriptionsParams ), @@ -181,7 +181,7 @@ def delete_subscriptions( if not collection: raise ValueError(f"Expected a non-empty value for `collection` but received {collection!r}") return self._post( - f"/v1/objects/{collection}/bulk/subscriptions/delete", + path_template("/v1/objects/{collection}/bulk/subscriptions/delete", collection=collection), body=maybe_transform( {"subscriptions": subscriptions}, bulk_delete_subscriptions_params.BulkDeleteSubscriptionsParams ), @@ -227,7 +227,7 @@ def set( if not collection: raise ValueError(f"Expected a non-empty value for `collection` but received {collection!r}") return self._post( - f"/v1/objects/{collection}/bulk/set", + path_template("/v1/objects/{collection}/bulk/set", collection=collection), body=maybe_transform({"objects": objects}, bulk_set_params.BulkSetParams), options=make_request_options( extra_headers=extra_headers, @@ -296,7 +296,7 @@ async def delete( if not collection: raise ValueError(f"Expected a non-empty value for `collection` but received {collection!r}") return await self._post( - f"/v1/objects/{collection}/bulk/delete", + path_template("/v1/objects/{collection}/bulk/delete", collection=collection), body=await async_maybe_transform({"object_ids": object_ids}, bulk_delete_params.BulkDeleteParams), options=make_request_options( extra_headers=extra_headers, @@ -345,7 +345,7 @@ async def add_subscriptions( if not collection: raise ValueError(f"Expected a non-empty value for `collection` but received {collection!r}") return await self._post( - f"/v1/objects/{collection}/bulk/subscriptions/add", + path_template("/v1/objects/{collection}/bulk/subscriptions/add", collection=collection), body=await async_maybe_transform( {"subscriptions": subscriptions}, bulk_add_subscriptions_params.BulkAddSubscriptionsParams ), @@ -393,7 +393,7 @@ async def delete_subscriptions( if not collection: raise ValueError(f"Expected a non-empty value for `collection` but received {collection!r}") return await self._post( - f"/v1/objects/{collection}/bulk/subscriptions/delete", + path_template("/v1/objects/{collection}/bulk/subscriptions/delete", collection=collection), body=await async_maybe_transform( {"subscriptions": subscriptions}, bulk_delete_subscriptions_params.BulkDeleteSubscriptionsParams ), @@ -439,7 +439,7 @@ async def set( if not collection: raise ValueError(f"Expected a non-empty value for `collection` but received {collection!r}") return await self._post( - f"/v1/objects/{collection}/bulk/set", + path_template("/v1/objects/{collection}/bulk/set", collection=collection), body=await async_maybe_transform({"objects": objects}, bulk_set_params.BulkSetParams), options=make_request_options( extra_headers=extra_headers, diff --git a/src/knockapi/resources/objects/objects.py b/src/knockapi/resources/objects/objects.py index 96c7bc1e..c928403b 100644 --- a/src/knockapi/resources/objects/objects.py +++ b/src/knockapi/resources/objects/objects.py @@ -27,7 +27,7 @@ object_delete_subscriptions_params, ) from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -125,7 +125,7 @@ def list( if not collection: raise ValueError(f"Expected a non-empty value for `collection` but received {collection!r}") return self._get_api_list( - f"/v1/objects/{collection}", + path_template("/v1/objects/{collection}", collection=collection), page=SyncEntriesCursor[Object], options=make_request_options( extra_headers=extra_headers, @@ -180,7 +180,7 @@ def delete( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return self._delete( - f"/v1/objects/{collection}/{id}", + path_template("/v1/objects/{collection}/{id}", collection=collection, id=id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -234,7 +234,9 @@ def add_subscriptions( if not object_id: raise ValueError(f"Expected a non-empty value for `object_id` but received {object_id!r}") return self._post( - f"/v1/objects/{collection}/{object_id}/subscriptions", + path_template( + "/v1/objects/{collection}/{object_id}/subscriptions", collection=collection, object_id=object_id + ), body=maybe_transform( { "recipients": recipients, @@ -290,7 +292,9 @@ def delete_subscriptions( if not object_id: raise ValueError(f"Expected a non-empty value for `object_id` but received {object_id!r}") return self._delete( - f"/v1/objects/{collection}/{object_id}/subscriptions", + path_template( + "/v1/objects/{collection}/{object_id}/subscriptions", collection=collection, object_id=object_id + ), body=maybe_transform( {"recipients": recipients}, object_delete_subscriptions_params.ObjectDeleteSubscriptionsParams ), @@ -335,7 +339,7 @@ def get( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get( - f"/v1/objects/{collection}/{id}", + path_template("/v1/objects/{collection}/{id}", collection=collection, id=id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -374,7 +378,12 @@ def get_channel_data( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return self._get( - f"/v1/objects/{collection}/{object_id}/channel_data/{channel_id}", + path_template( + "/v1/objects/{collection}/{object_id}/channel_data/{channel_id}", + collection=collection, + object_id=object_id, + channel_id=channel_id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -413,7 +422,12 @@ def get_preferences( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get( - f"/v1/objects/{collection}/{object_id}/preferences/{id}", + path_template( + "/v1/objects/{collection}/{object_id}/preferences/{id}", + collection=collection, + object_id=object_id, + id=id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -499,7 +513,7 @@ def list_messages( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get_api_list( - f"/v1/objects/{collection}/{id}/messages", + path_template("/v1/objects/{collection}/{id}/messages", collection=collection, id=id), page=SyncItemsCursor[Message], options=make_request_options( extra_headers=extra_headers, @@ -558,7 +572,9 @@ def list_preferences( if not object_id: raise ValueError(f"Expected a non-empty value for `object_id` but received {object_id!r}") return self._get( - f"/v1/objects/{collection}/{object_id}/preferences", + path_template( + "/v1/objects/{collection}/{object_id}/preferences", collection=collection, object_id=object_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -609,7 +625,7 @@ def list_schedules( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get_api_list( - f"/v1/objects/{collection}/{id}/schedules", + path_template("/v1/objects/{collection}/{id}/schedules", collection=collection, id=id), page=SyncEntriesCursor[Schedule], options=make_request_options( extra_headers=extra_headers, @@ -685,7 +701,9 @@ def list_subscriptions( if not object_id: raise ValueError(f"Expected a non-empty value for `object_id` but received {object_id!r}") return self._get_api_list( - f"/v1/objects/{collection}/{object_id}/subscriptions", + path_template( + "/v1/objects/{collection}/{object_id}/subscriptions", collection=collection, object_id=object_id + ), page=SyncEntriesCursor[Subscription], options=make_request_options( extra_headers=extra_headers, @@ -763,7 +781,7 @@ def set( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._put( - f"/v1/objects/{collection}/{id}", + path_template("/v1/objects/{collection}/{id}", collection=collection, id=id), body=maybe_transform( { "channel_data": channel_data, @@ -825,7 +843,12 @@ def set_channel_data( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return self._put( - f"/v1/objects/{collection}/{object_id}/channel_data/{channel_id}", + path_template( + "/v1/objects/{collection}/{object_id}/channel_data/{channel_id}", + collection=collection, + object_id=object_id, + channel_id=channel_id, + ), body=maybe_transform({"data": data}, object_set_channel_data_params.ObjectSetChannelDataParams), options=make_request_options( extra_headers=extra_headers, @@ -902,7 +925,12 @@ def set_preferences( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._put( - f"/v1/objects/{collection}/{object_id}/preferences/{id}", + path_template( + "/v1/objects/{collection}/{object_id}/preferences/{id}", + collection=collection, + object_id=object_id, + id=id, + ), body=maybe_transform( { "_persistence_strategy": _persistence_strategy, @@ -960,7 +988,12 @@ def unset_channel_data( raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return self._delete( - f"/v1/objects/{collection}/{object_id}/channel_data/{channel_id}", + path_template( + "/v1/objects/{collection}/{object_id}/channel_data/{channel_id}", + collection=collection, + object_id=object_id, + channel_id=channel_id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1041,7 +1074,7 @@ def list( if not collection: raise ValueError(f"Expected a non-empty value for `collection` but received {collection!r}") return self._get_api_list( - f"/v1/objects/{collection}", + path_template("/v1/objects/{collection}", collection=collection), page=AsyncEntriesCursor[Object], options=make_request_options( extra_headers=extra_headers, @@ -1096,7 +1129,7 @@ async def delete( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return await self._delete( - f"/v1/objects/{collection}/{id}", + path_template("/v1/objects/{collection}/{id}", collection=collection, id=id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1150,7 +1183,9 @@ async def add_subscriptions( if not object_id: raise ValueError(f"Expected a non-empty value for `object_id` but received {object_id!r}") return await self._post( - f"/v1/objects/{collection}/{object_id}/subscriptions", + path_template( + "/v1/objects/{collection}/{object_id}/subscriptions", collection=collection, object_id=object_id + ), body=await async_maybe_transform( { "recipients": recipients, @@ -1206,7 +1241,9 @@ async def delete_subscriptions( if not object_id: raise ValueError(f"Expected a non-empty value for `object_id` but received {object_id!r}") return await self._delete( - f"/v1/objects/{collection}/{object_id}/subscriptions", + path_template( + "/v1/objects/{collection}/{object_id}/subscriptions", collection=collection, object_id=object_id + ), body=await async_maybe_transform( {"recipients": recipients}, object_delete_subscriptions_params.ObjectDeleteSubscriptionsParams ), @@ -1251,7 +1288,7 @@ async def get( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._get( - f"/v1/objects/{collection}/{id}", + path_template("/v1/objects/{collection}/{id}", collection=collection, id=id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -1290,7 +1327,12 @@ async def get_channel_data( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return await self._get( - f"/v1/objects/{collection}/{object_id}/channel_data/{channel_id}", + path_template( + "/v1/objects/{collection}/{object_id}/channel_data/{channel_id}", + collection=collection, + object_id=object_id, + channel_id=channel_id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -1329,7 +1371,12 @@ async def get_preferences( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._get( - f"/v1/objects/{collection}/{object_id}/preferences/{id}", + path_template( + "/v1/objects/{collection}/{object_id}/preferences/{id}", + collection=collection, + object_id=object_id, + id=id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -1415,7 +1462,7 @@ def list_messages( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get_api_list( - f"/v1/objects/{collection}/{id}/messages", + path_template("/v1/objects/{collection}/{id}/messages", collection=collection, id=id), page=AsyncItemsCursor[Message], options=make_request_options( extra_headers=extra_headers, @@ -1474,7 +1521,9 @@ async def list_preferences( if not object_id: raise ValueError(f"Expected a non-empty value for `object_id` but received {object_id!r}") return await self._get( - f"/v1/objects/{collection}/{object_id}/preferences", + path_template( + "/v1/objects/{collection}/{object_id}/preferences", collection=collection, object_id=object_id + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -1525,7 +1574,7 @@ def list_schedules( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get_api_list( - f"/v1/objects/{collection}/{id}/schedules", + path_template("/v1/objects/{collection}/{id}/schedules", collection=collection, id=id), page=AsyncEntriesCursor[Schedule], options=make_request_options( extra_headers=extra_headers, @@ -1601,7 +1650,9 @@ def list_subscriptions( if not object_id: raise ValueError(f"Expected a non-empty value for `object_id` but received {object_id!r}") return self._get_api_list( - f"/v1/objects/{collection}/{object_id}/subscriptions", + path_template( + "/v1/objects/{collection}/{object_id}/subscriptions", collection=collection, object_id=object_id + ), page=AsyncEntriesCursor[Subscription], options=make_request_options( extra_headers=extra_headers, @@ -1679,7 +1730,7 @@ async def set( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._put( - f"/v1/objects/{collection}/{id}", + path_template("/v1/objects/{collection}/{id}", collection=collection, id=id), body=await async_maybe_transform( { "channel_data": channel_data, @@ -1741,7 +1792,12 @@ async def set_channel_data( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return await self._put( - f"/v1/objects/{collection}/{object_id}/channel_data/{channel_id}", + path_template( + "/v1/objects/{collection}/{object_id}/channel_data/{channel_id}", + collection=collection, + object_id=object_id, + channel_id=channel_id, + ), body=await async_maybe_transform({"data": data}, object_set_channel_data_params.ObjectSetChannelDataParams), options=make_request_options( extra_headers=extra_headers, @@ -1818,7 +1874,12 @@ async def set_preferences( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._put( - f"/v1/objects/{collection}/{object_id}/preferences/{id}", + path_template( + "/v1/objects/{collection}/{object_id}/preferences/{id}", + collection=collection, + object_id=object_id, + id=id, + ), body=await async_maybe_transform( { "_persistence_strategy": _persistence_strategy, @@ -1876,7 +1937,12 @@ async def unset_channel_data( raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return await self._delete( - f"/v1/objects/{collection}/{object_id}/channel_data/{channel_id}", + path_template( + "/v1/objects/{collection}/{object_id}/channel_data/{channel_id}", + collection=collection, + object_id=object_id, + channel_id=channel_id, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/knockapi/resources/providers/ms_teams.py b/src/knockapi/resources/providers/ms_teams.py index c5fd020b..e36d8d56 100644 --- a/src/knockapi/resources/providers/ms_teams.py +++ b/src/knockapi/resources/providers/ms_teams.py @@ -5,7 +5,7 @@ import httpx from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -84,7 +84,7 @@ def check_auth( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return self._get( - f"/v1/providers/ms-teams/{channel_id}/auth_check", + path_template("/v1/providers/ms-teams/{channel_id}/auth_check", channel_id=channel_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -132,7 +132,7 @@ def list_channels( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return self._get( - f"/v1/providers/ms-teams/{channel_id}/channels", + path_template("/v1/providers/ms-teams/{channel_id}/channels", channel_id=channel_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -182,7 +182,7 @@ def list_teams( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return self._get_api_list( - f"/v1/providers/ms-teams/{channel_id}/teams", + path_template("/v1/providers/ms-teams/{channel_id}/teams", channel_id=channel_id), page=SyncMsTeamsPagination[MsTeamListTeamsResponse], options=make_request_options( extra_headers=extra_headers, @@ -232,7 +232,7 @@ def revoke_access( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return self._put( - f"/v1/providers/ms-teams/{channel_id}/revoke_access", + path_template("/v1/providers/ms-teams/{channel_id}/revoke_access", channel_id=channel_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -302,7 +302,7 @@ async def check_auth( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return await self._get( - f"/v1/providers/ms-teams/{channel_id}/auth_check", + path_template("/v1/providers/ms-teams/{channel_id}/auth_check", channel_id=channel_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -350,7 +350,7 @@ async def list_channels( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return await self._get( - f"/v1/providers/ms-teams/{channel_id}/channels", + path_template("/v1/providers/ms-teams/{channel_id}/channels", channel_id=channel_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -400,7 +400,7 @@ def list_teams( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return self._get_api_list( - f"/v1/providers/ms-teams/{channel_id}/teams", + path_template("/v1/providers/ms-teams/{channel_id}/teams", channel_id=channel_id), page=AsyncMsTeamsPagination[MsTeamListTeamsResponse], options=make_request_options( extra_headers=extra_headers, @@ -450,7 +450,7 @@ async def revoke_access( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return await self._put( - f"/v1/providers/ms-teams/{channel_id}/revoke_access", + path_template("/v1/providers/ms-teams/{channel_id}/revoke_access", channel_id=channel_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/knockapi/resources/providers/slack.py b/src/knockapi/resources/providers/slack.py index d9939596..b1340079 100644 --- a/src/knockapi/resources/providers/slack.py +++ b/src/knockapi/resources/providers/slack.py @@ -5,7 +5,7 @@ import httpx from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -77,7 +77,7 @@ def check_auth( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return self._get( - f"/v1/providers/slack/{channel_id}/auth_check", + path_template("/v1/providers/slack/{channel_id}/auth_check", channel_id=channel_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -120,7 +120,7 @@ def list_channels( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return self._get_api_list( - f"/v1/providers/slack/{channel_id}/channels", + path_template("/v1/providers/slack/{channel_id}/channels", channel_id=channel_id), page=SyncSlackChannelsCursor[SlackListChannelsResponse], options=make_request_options( extra_headers=extra_headers, @@ -170,7 +170,7 @@ def revoke_access( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return self._put( - f"/v1/providers/slack/{channel_id}/revoke_access", + path_template("/v1/providers/slack/{channel_id}/revoke_access", channel_id=channel_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -238,7 +238,7 @@ async def check_auth( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return await self._get( - f"/v1/providers/slack/{channel_id}/auth_check", + path_template("/v1/providers/slack/{channel_id}/auth_check", channel_id=channel_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -281,7 +281,7 @@ def list_channels( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return self._get_api_list( - f"/v1/providers/slack/{channel_id}/channels", + path_template("/v1/providers/slack/{channel_id}/channels", channel_id=channel_id), page=AsyncSlackChannelsCursor[SlackListChannelsResponse], options=make_request_options( extra_headers=extra_headers, @@ -331,7 +331,7 @@ async def revoke_access( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return await self._put( - f"/v1/providers/slack/{channel_id}/revoke_access", + path_template("/v1/providers/slack/{channel_id}/revoke_access", channel_id=channel_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/knockapi/resources/tenants/tenants.py b/src/knockapi/resources/tenants/tenants.py index 9fdee42f..d52fabf2 100644 --- a/src/knockapi/resources/tenants/tenants.py +++ b/src/knockapi/resources/tenants/tenants.py @@ -16,7 +16,7 @@ ) from ...types import tenant_get_params, tenant_set_params, tenant_list_params from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -154,7 +154,7 @@ def delete( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return self._delete( - f"/v1/tenants/{id}", + path_template("/v1/tenants/{id}", id=id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -196,7 +196,7 @@ def get( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get( - f"/v1/tenants/{id}", + path_template("/v1/tenants/{id}", id=id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -255,7 +255,7 @@ def set( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._put( - f"/v1/tenants/{id}", + path_template("/v1/tenants/{id}", id=id), body=maybe_transform( { "channel_data": channel_data, @@ -400,7 +400,7 @@ async def delete( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return await self._delete( - f"/v1/tenants/{id}", + path_template("/v1/tenants/{id}", id=id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -442,7 +442,7 @@ async def get( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._get( - f"/v1/tenants/{id}", + path_template("/v1/tenants/{id}", id=id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -501,7 +501,7 @@ async def set( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._put( - f"/v1/tenants/{id}", + path_template("/v1/tenants/{id}", id=id), body=await async_maybe_transform( { "channel_data": channel_data, diff --git a/src/knockapi/resources/users/feeds.py b/src/knockapi/resources/users/feeds.py index 2ba95f7a..8f1836c2 100644 --- a/src/knockapi/resources/users/feeds.py +++ b/src/knockapi/resources/users/feeds.py @@ -7,7 +7,7 @@ import httpx from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from ..._utils import maybe_transform +from ..._utils import path_template, maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -79,7 +79,7 @@ def get_settings( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get( - f"/v1/users/{user_id}/feeds/{id}/settings", + path_template("/v1/users/{user_id}/feeds/{id}/settings", user_id=user_id, id=id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -179,7 +179,7 @@ def list_items( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get_api_list( - f"/v1/users/{user_id}/feeds/{id}", + path_template("/v1/users/{user_id}/feeds/{id}", user_id=user_id, id=id), page=SyncEntriesCursor[FeedListItemsResponse], options=make_request_options( extra_headers=extra_headers, @@ -264,7 +264,7 @@ async def get_settings( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._get( - f"/v1/users/{user_id}/feeds/{id}/settings", + path_template("/v1/users/{user_id}/feeds/{id}/settings", user_id=user_id, id=id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -364,7 +364,7 @@ def list_items( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get_api_list( - f"/v1/users/{user_id}/feeds/{id}", + path_template("/v1/users/{user_id}/feeds/{id}", user_id=user_id, id=id), page=AsyncEntriesCursor[FeedListItemsResponse], options=make_request_options( extra_headers=extra_headers, diff --git a/src/knockapi/resources/users/guides.py b/src/knockapi/resources/users/guides.py index c308b573..59477812 100644 --- a/src/knockapi/resources/users/guides.py +++ b/src/knockapi/resources/users/guides.py @@ -7,7 +7,7 @@ import httpx from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -94,7 +94,7 @@ def get_channel( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return self._get( - f"/v1/users/{user_id}/guides/{channel_id}", + path_template("/v1/users/{user_id}/guides/{channel_id}", user_id=user_id, channel_id=channel_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -172,7 +172,9 @@ def mark_message_as_archived( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._put( - f"/v1/users/{user_id}/guides/messages/{message_id}/archived", + path_template( + "/v1/users/{user_id}/guides/messages/{message_id}/archived", user_id=user_id, message_id=message_id + ), body=maybe_transform( { "channel_id": channel_id, @@ -257,7 +259,9 @@ def mark_message_as_interacted( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._put( - f"/v1/users/{user_id}/guides/messages/{message_id}/interacted", + path_template( + "/v1/users/{user_id}/guides/messages/{message_id}/interacted", user_id=user_id, message_id=message_id + ), body=maybe_transform( { "channel_id": channel_id, @@ -342,7 +346,9 @@ def mark_message_as_seen( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return self._put( - f"/v1/users/{user_id}/guides/messages/{message_id}/seen", + path_template( + "/v1/users/{user_id}/guides/messages/{message_id}/seen", user_id=user_id, message_id=message_id + ), body=maybe_transform( { "channel_id": channel_id, @@ -431,7 +437,7 @@ async def get_channel( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return await self._get( - f"/v1/users/{user_id}/guides/{channel_id}", + path_template("/v1/users/{user_id}/guides/{channel_id}", user_id=user_id, channel_id=channel_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -509,7 +515,9 @@ async def mark_message_as_archived( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return await self._put( - f"/v1/users/{user_id}/guides/messages/{message_id}/archived", + path_template( + "/v1/users/{user_id}/guides/messages/{message_id}/archived", user_id=user_id, message_id=message_id + ), body=await async_maybe_transform( { "channel_id": channel_id, @@ -594,7 +602,9 @@ async def mark_message_as_interacted( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return await self._put( - f"/v1/users/{user_id}/guides/messages/{message_id}/interacted", + path_template( + "/v1/users/{user_id}/guides/messages/{message_id}/interacted", user_id=user_id, message_id=message_id + ), body=await async_maybe_transform( { "channel_id": channel_id, @@ -679,7 +689,9 @@ async def mark_message_as_seen( if not message_id: raise ValueError(f"Expected a non-empty value for `message_id` but received {message_id!r}") return await self._put( - f"/v1/users/{user_id}/guides/messages/{message_id}/seen", + path_template( + "/v1/users/{user_id}/guides/messages/{message_id}/seen", user_id=user_id, message_id=message_id + ), body=await async_maybe_transform( { "channel_id": channel_id, diff --git a/src/knockapi/resources/users/users.py b/src/knockapi/resources/users/users.py index c60bbc2f..4146e3ab 100644 --- a/src/knockapi/resources/users/users.py +++ b/src/knockapi/resources/users/users.py @@ -44,7 +44,7 @@ user_list_subscriptions_params, ) from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given -from ..._utils import maybe_transform, async_maybe_transform +from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -183,7 +183,7 @@ def update( if not user_id: raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") return self._put( - f"/v1/users/{user_id}", + path_template("/v1/users/{user_id}", user_id=user_id), body=maybe_transform( { "avatar": avatar, @@ -295,7 +295,7 @@ def delete( raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return self._delete( - f"/v1/users/{user_id}", + path_template("/v1/users/{user_id}", user_id=user_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -332,7 +332,7 @@ def get( if not user_id: raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") return self._get( - f"/v1/users/{user_id}", + path_template("/v1/users/{user_id}", user_id=user_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -368,7 +368,7 @@ def get_channel_data( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return self._get( - f"/v1/users/{user_id}/channel_data/{channel_id}", + path_template("/v1/users/{user_id}/channel_data/{channel_id}", user_id=user_id, channel_id=channel_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -408,7 +408,7 @@ def get_preferences( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get( - f"/v1/users/{user_id}/preferences/{id}", + path_template("/v1/users/{user_id}/preferences/{id}", user_id=user_id, id=id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -496,7 +496,7 @@ def list_messages( if not user_id: raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") return self._get_api_list( - f"/v1/users/{user_id}/messages", + path_template("/v1/users/{user_id}/messages", user_id=user_id), page=SyncItemsCursor[Message], options=make_request_options( extra_headers=extra_headers, @@ -552,7 +552,7 @@ def list_preferences( if not user_id: raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") return self._get( - f"/v1/users/{user_id}/preferences", + path_template("/v1/users/{user_id}/preferences", user_id=user_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -600,7 +600,7 @@ def list_schedules( if not user_id: raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") return self._get_api_list( - f"/v1/users/{user_id}/schedules", + path_template("/v1/users/{user_id}/schedules", user_id=user_id), page=SyncEntriesCursor[Schedule], options=make_request_options( extra_headers=extra_headers, @@ -663,7 +663,7 @@ def list_subscriptions( if not user_id: raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") return self._get_api_list( - f"/v1/users/{user_id}/subscriptions", + path_template("/v1/users/{user_id}/subscriptions", user_id=user_id), page=SyncEntriesCursor[Subscription], options=make_request_options( extra_headers=extra_headers, @@ -717,7 +717,7 @@ def merge( if not user_id: raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") return self._post( - f"/v1/users/{user_id}/merge", + path_template("/v1/users/{user_id}/merge", user_id=user_id), body=maybe_transform({"from_user_id": from_user_id}, user_merge_params.UserMergeParams), options=make_request_options( extra_headers=extra_headers, @@ -767,7 +767,7 @@ def set_channel_data( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return self._put( - f"/v1/users/{user_id}/channel_data/{channel_id}", + path_template("/v1/users/{user_id}/channel_data/{channel_id}", user_id=user_id, channel_id=channel_id), body=maybe_transform({"data": data}, user_set_channel_data_params.UserSetChannelDataParams), options=make_request_options( extra_headers=extra_headers, @@ -837,7 +837,7 @@ def set_preferences( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._put( - f"/v1/users/{user_id}/preferences/{id}", + path_template("/v1/users/{user_id}/preferences/{id}", user_id=user_id, id=id), body=maybe_transform( { "_persistence_strategy": _persistence_strategy, @@ -892,7 +892,7 @@ def unset_channel_data( raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return self._delete( - f"/v1/users/{user_id}/channel_data/{channel_id}", + path_template("/v1/users/{user_id}/channel_data/{channel_id}", user_id=user_id, channel_id=channel_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1017,7 +1017,7 @@ async def update( if not user_id: raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") return await self._put( - f"/v1/users/{user_id}", + path_template("/v1/users/{user_id}", user_id=user_id), body=await async_maybe_transform( { "avatar": avatar, @@ -1129,7 +1129,7 @@ async def delete( raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return await self._delete( - f"/v1/users/{user_id}", + path_template("/v1/users/{user_id}", user_id=user_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1166,7 +1166,7 @@ async def get( if not user_id: raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") return await self._get( - f"/v1/users/{user_id}", + path_template("/v1/users/{user_id}", user_id=user_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -1202,7 +1202,7 @@ async def get_channel_data( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return await self._get( - f"/v1/users/{user_id}/channel_data/{channel_id}", + path_template("/v1/users/{user_id}/channel_data/{channel_id}", user_id=user_id, channel_id=channel_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -1242,7 +1242,7 @@ async def get_preferences( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._get( - f"/v1/users/{user_id}/preferences/{id}", + path_template("/v1/users/{user_id}/preferences/{id}", user_id=user_id, id=id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -1332,7 +1332,7 @@ def list_messages( if not user_id: raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") return self._get_api_list( - f"/v1/users/{user_id}/messages", + path_template("/v1/users/{user_id}/messages", user_id=user_id), page=AsyncItemsCursor[Message], options=make_request_options( extra_headers=extra_headers, @@ -1388,7 +1388,7 @@ async def list_preferences( if not user_id: raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") return await self._get( - f"/v1/users/{user_id}/preferences", + path_template("/v1/users/{user_id}/preferences", user_id=user_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), @@ -1436,7 +1436,7 @@ def list_schedules( if not user_id: raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") return self._get_api_list( - f"/v1/users/{user_id}/schedules", + path_template("/v1/users/{user_id}/schedules", user_id=user_id), page=AsyncEntriesCursor[Schedule], options=make_request_options( extra_headers=extra_headers, @@ -1499,7 +1499,7 @@ def list_subscriptions( if not user_id: raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") return self._get_api_list( - f"/v1/users/{user_id}/subscriptions", + path_template("/v1/users/{user_id}/subscriptions", user_id=user_id), page=AsyncEntriesCursor[Subscription], options=make_request_options( extra_headers=extra_headers, @@ -1553,7 +1553,7 @@ async def merge( if not user_id: raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") return await self._post( - f"/v1/users/{user_id}/merge", + path_template("/v1/users/{user_id}/merge", user_id=user_id), body=await async_maybe_transform({"from_user_id": from_user_id}, user_merge_params.UserMergeParams), options=make_request_options( extra_headers=extra_headers, @@ -1603,7 +1603,7 @@ async def set_channel_data( if not channel_id: raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") return await self._put( - f"/v1/users/{user_id}/channel_data/{channel_id}", + path_template("/v1/users/{user_id}/channel_data/{channel_id}", user_id=user_id, channel_id=channel_id), body=await async_maybe_transform({"data": data}, user_set_channel_data_params.UserSetChannelDataParams), options=make_request_options( extra_headers=extra_headers, @@ -1673,7 +1673,7 @@ async def set_preferences( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._put( - f"/v1/users/{user_id}/preferences/{id}", + path_template("/v1/users/{user_id}/preferences/{id}", user_id=user_id, id=id), body=await async_maybe_transform( { "_persistence_strategy": _persistence_strategy, @@ -1728,7 +1728,7 @@ async def unset_channel_data( raise ValueError(f"Expected a non-empty value for `channel_id` but received {channel_id!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return await self._delete( - f"/v1/users/{user_id}/channel_data/{channel_id}", + path_template("/v1/users/{user_id}/channel_data/{channel_id}", user_id=user_id, channel_id=channel_id), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/knockapi/resources/workflows.py b/src/knockapi/resources/workflows.py index d6012ebd..6080eb85 100644 --- a/src/knockapi/resources/workflows.py +++ b/src/knockapi/resources/workflows.py @@ -8,7 +8,7 @@ from ..types import workflow_cancel_params, workflow_trigger_params from .._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given -from .._utils import maybe_transform, async_maybe_transform +from .._utils import path_template, maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( @@ -93,7 +93,7 @@ def cancel( raise ValueError(f"Expected a non-empty value for `key` but received {key!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return self._post( - f"/v1/workflows/{key}/cancel", + path_template("/v1/workflows/{key}/cancel", key=key), body=maybe_transform( { "cancellation_key": cancellation_key, @@ -169,7 +169,7 @@ def trigger( if not key: raise ValueError(f"Expected a non-empty value for `key` but received {key!r}") return self._post( - f"/v1/workflows/{key}/trigger", + path_template("/v1/workflows/{key}/trigger", key=key), body=maybe_transform( { "recipients": recipients, @@ -258,7 +258,7 @@ async def cancel( raise ValueError(f"Expected a non-empty value for `key` but received {key!r}") extra_headers = {"Accept": "*/*", **(extra_headers or {})} return await self._post( - f"/v1/workflows/{key}/cancel", + path_template("/v1/workflows/{key}/cancel", key=key), body=await async_maybe_transform( { "cancellation_key": cancellation_key, @@ -334,7 +334,7 @@ async def trigger( if not key: raise ValueError(f"Expected a non-empty value for `key` but received {key!r}") return await self._post( - f"/v1/workflows/{key}/trigger", + path_template("/v1/workflows/{key}/trigger", key=key), body=await async_maybe_transform( { "recipients": recipients, diff --git a/tests/api_resources/channels/test_bulk.py b/tests/api_resources/channels/test_bulk.py index 189a5b57..1c5c4f51 100644 --- a/tests/api_resources/channels/test_bulk.py +++ b/tests/api_resources/channels/test_bulk.py @@ -18,7 +18,6 @@ class TestBulk: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_update_message_status(self, client: Knock) -> None: bulk = client.channels.bulk.update_message_status( @@ -27,7 +26,6 @@ def test_method_update_message_status(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_update_message_status_with_all_params(self, client: Knock) -> None: bulk = client.channels.bulk.update_message_status( @@ -46,7 +44,6 @@ def test_method_update_message_status_with_all_params(self, client: Knock) -> No ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_update_message_status(self, client: Knock) -> None: response = client.channels.bulk.with_raw_response.update_message_status( @@ -59,7 +56,6 @@ def test_raw_response_update_message_status(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_update_message_status(self, client: Knock) -> None: with client.channels.bulk.with_streaming_response.update_message_status( @@ -74,7 +70,6 @@ def test_streaming_response_update_message_status(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_update_message_status(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -89,7 +84,6 @@ class TestAsyncBulk: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_update_message_status(self, async_client: AsyncKnock) -> None: bulk = await async_client.channels.bulk.update_message_status( @@ -98,7 +92,6 @@ async def test_method_update_message_status(self, async_client: AsyncKnock) -> N ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_update_message_status_with_all_params(self, async_client: AsyncKnock) -> None: bulk = await async_client.channels.bulk.update_message_status( @@ -117,7 +110,6 @@ async def test_method_update_message_status_with_all_params(self, async_client: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_update_message_status(self, async_client: AsyncKnock) -> None: response = await async_client.channels.bulk.with_raw_response.update_message_status( @@ -130,7 +122,6 @@ async def test_raw_response_update_message_status(self, async_client: AsyncKnock bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_update_message_status(self, async_client: AsyncKnock) -> None: async with async_client.channels.bulk.with_streaming_response.update_message_status( @@ -145,7 +136,6 @@ async def test_streaming_response_update_message_status(self, async_client: Asyn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_update_message_status(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): diff --git a/tests/api_resources/integrations/test_census.py b/tests/api_resources/integrations/test_census.py index aaa71a34..71490805 100644 --- a/tests/api_resources/integrations/test_census.py +++ b/tests/api_resources/integrations/test_census.py @@ -17,7 +17,6 @@ class TestCensus: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_custom_destination(self, client: Knock) -> None: census = client.integrations.census.custom_destination( @@ -27,7 +26,6 @@ def test_method_custom_destination(self, client: Knock) -> None: ) assert_matches_type(CensusCustomDestinationResponse, census, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_custom_destination_with_all_params(self, client: Knock) -> None: census = client.integrations.census.custom_destination( @@ -38,7 +36,6 @@ def test_method_custom_destination_with_all_params(self, client: Knock) -> None: ) assert_matches_type(CensusCustomDestinationResponse, census, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_custom_destination(self, client: Knock) -> None: response = client.integrations.census.with_raw_response.custom_destination( @@ -52,7 +49,6 @@ def test_raw_response_custom_destination(self, client: Knock) -> None: census = response.parse() assert_matches_type(CensusCustomDestinationResponse, census, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_custom_destination(self, client: Knock) -> None: with client.integrations.census.with_streaming_response.custom_destination( @@ -74,7 +70,6 @@ class TestAsyncCensus: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_custom_destination(self, async_client: AsyncKnock) -> None: census = await async_client.integrations.census.custom_destination( @@ -84,7 +79,6 @@ async def test_method_custom_destination(self, async_client: AsyncKnock) -> None ) assert_matches_type(CensusCustomDestinationResponse, census, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_custom_destination_with_all_params(self, async_client: AsyncKnock) -> None: census = await async_client.integrations.census.custom_destination( @@ -95,7 +89,6 @@ async def test_method_custom_destination_with_all_params(self, async_client: Asy ) assert_matches_type(CensusCustomDestinationResponse, census, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_custom_destination(self, async_client: AsyncKnock) -> None: response = await async_client.integrations.census.with_raw_response.custom_destination( @@ -109,7 +102,6 @@ async def test_raw_response_custom_destination(self, async_client: AsyncKnock) - census = await response.parse() assert_matches_type(CensusCustomDestinationResponse, census, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_custom_destination(self, async_client: AsyncKnock) -> None: async with async_client.integrations.census.with_streaming_response.custom_destination( diff --git a/tests/api_resources/integrations/test_hightouch.py b/tests/api_resources/integrations/test_hightouch.py index 98943421..14b4f67f 100644 --- a/tests/api_resources/integrations/test_hightouch.py +++ b/tests/api_resources/integrations/test_hightouch.py @@ -17,7 +17,6 @@ class TestHightouch: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_embedded_destination(self, client: Knock) -> None: hightouch = client.integrations.hightouch.embedded_destination( @@ -27,7 +26,6 @@ def test_method_embedded_destination(self, client: Knock) -> None: ) assert_matches_type(HightouchEmbeddedDestinationResponse, hightouch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_embedded_destination_with_all_params(self, client: Knock) -> None: hightouch = client.integrations.hightouch.embedded_destination( @@ -38,7 +36,6 @@ def test_method_embedded_destination_with_all_params(self, client: Knock) -> Non ) assert_matches_type(HightouchEmbeddedDestinationResponse, hightouch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_embedded_destination(self, client: Knock) -> None: response = client.integrations.hightouch.with_raw_response.embedded_destination( @@ -52,7 +49,6 @@ def test_raw_response_embedded_destination(self, client: Knock) -> None: hightouch = response.parse() assert_matches_type(HightouchEmbeddedDestinationResponse, hightouch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_embedded_destination(self, client: Knock) -> None: with client.integrations.hightouch.with_streaming_response.embedded_destination( @@ -74,7 +70,6 @@ class TestAsyncHightouch: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_embedded_destination(self, async_client: AsyncKnock) -> None: hightouch = await async_client.integrations.hightouch.embedded_destination( @@ -84,7 +79,6 @@ async def test_method_embedded_destination(self, async_client: AsyncKnock) -> No ) assert_matches_type(HightouchEmbeddedDestinationResponse, hightouch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_embedded_destination_with_all_params(self, async_client: AsyncKnock) -> None: hightouch = await async_client.integrations.hightouch.embedded_destination( @@ -95,7 +89,6 @@ async def test_method_embedded_destination_with_all_params(self, async_client: A ) assert_matches_type(HightouchEmbeddedDestinationResponse, hightouch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_embedded_destination(self, async_client: AsyncKnock) -> None: response = await async_client.integrations.hightouch.with_raw_response.embedded_destination( @@ -109,7 +102,6 @@ async def test_raw_response_embedded_destination(self, async_client: AsyncKnock) hightouch = await response.parse() assert_matches_type(HightouchEmbeddedDestinationResponse, hightouch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_embedded_destination(self, async_client: AsyncKnock) -> None: async with async_client.integrations.hightouch.with_streaming_response.embedded_destination( diff --git a/tests/api_resources/messages/test_batch.py b/tests/api_resources/messages/test_batch.py index 1e3ee077..5f2b0f3a 100644 --- a/tests/api_resources/messages/test_batch.py +++ b/tests/api_resources/messages/test_batch.py @@ -26,7 +26,6 @@ class TestBatch: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_archive(self, client: Knock) -> None: batch = client.messages.batch.archive( @@ -34,7 +33,6 @@ def test_method_archive(self, client: Knock) -> None: ) assert_matches_type(BatchArchiveResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_archive(self, client: Knock) -> None: response = client.messages.batch.with_raw_response.archive( @@ -46,7 +44,6 @@ def test_raw_response_archive(self, client: Knock) -> None: batch = response.parse() assert_matches_type(BatchArchiveResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_archive(self, client: Knock) -> None: with client.messages.batch.with_streaming_response.archive( @@ -60,7 +57,6 @@ def test_streaming_response_archive(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_content(self, client: Knock) -> None: batch = client.messages.batch.get_content( @@ -68,7 +64,6 @@ def test_method_get_content(self, client: Knock) -> None: ) assert_matches_type(BatchGetContentResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get_content(self, client: Knock) -> None: response = client.messages.batch.with_raw_response.get_content( @@ -80,7 +75,6 @@ def test_raw_response_get_content(self, client: Knock) -> None: batch = response.parse() assert_matches_type(BatchGetContentResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get_content(self, client: Knock) -> None: with client.messages.batch.with_streaming_response.get_content( @@ -94,7 +88,6 @@ def test_streaming_response_get_content(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_interacted(self, client: Knock) -> None: batch = client.messages.batch.mark_as_interacted( @@ -102,7 +95,6 @@ def test_method_mark_as_interacted(self, client: Knock) -> None: ) assert_matches_type(BatchMarkAsInteractedResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_interacted_with_all_params(self, client: Knock) -> None: batch = client.messages.batch.mark_as_interacted( @@ -111,7 +103,6 @@ def test_method_mark_as_interacted_with_all_params(self, client: Knock) -> None: ) assert_matches_type(BatchMarkAsInteractedResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_interacted(self, client: Knock) -> None: response = client.messages.batch.with_raw_response.mark_as_interacted( @@ -123,7 +114,6 @@ def test_raw_response_mark_as_interacted(self, client: Knock) -> None: batch = response.parse() assert_matches_type(BatchMarkAsInteractedResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_interacted(self, client: Knock) -> None: with client.messages.batch.with_streaming_response.mark_as_interacted( @@ -137,7 +127,6 @@ def test_streaming_response_mark_as_interacted(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_read(self, client: Knock) -> None: batch = client.messages.batch.mark_as_read( @@ -145,7 +134,6 @@ def test_method_mark_as_read(self, client: Knock) -> None: ) assert_matches_type(BatchMarkAsReadResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_read(self, client: Knock) -> None: response = client.messages.batch.with_raw_response.mark_as_read( @@ -157,7 +145,6 @@ def test_raw_response_mark_as_read(self, client: Knock) -> None: batch = response.parse() assert_matches_type(BatchMarkAsReadResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_read(self, client: Knock) -> None: with client.messages.batch.with_streaming_response.mark_as_read( @@ -171,7 +158,6 @@ def test_streaming_response_mark_as_read(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_seen(self, client: Knock) -> None: batch = client.messages.batch.mark_as_seen( @@ -179,7 +165,6 @@ def test_method_mark_as_seen(self, client: Knock) -> None: ) assert_matches_type(BatchMarkAsSeenResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_seen(self, client: Knock) -> None: response = client.messages.batch.with_raw_response.mark_as_seen( @@ -191,7 +176,6 @@ def test_raw_response_mark_as_seen(self, client: Knock) -> None: batch = response.parse() assert_matches_type(BatchMarkAsSeenResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_seen(self, client: Knock) -> None: with client.messages.batch.with_streaming_response.mark_as_seen( @@ -205,7 +189,6 @@ def test_streaming_response_mark_as_seen(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_unread(self, client: Knock) -> None: batch = client.messages.batch.mark_as_unread( @@ -213,7 +196,6 @@ def test_method_mark_as_unread(self, client: Knock) -> None: ) assert_matches_type(BatchMarkAsUnreadResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_unread(self, client: Knock) -> None: response = client.messages.batch.with_raw_response.mark_as_unread( @@ -225,7 +207,6 @@ def test_raw_response_mark_as_unread(self, client: Knock) -> None: batch = response.parse() assert_matches_type(BatchMarkAsUnreadResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_unread(self, client: Knock) -> None: with client.messages.batch.with_streaming_response.mark_as_unread( @@ -239,7 +220,6 @@ def test_streaming_response_mark_as_unread(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_unseen(self, client: Knock) -> None: batch = client.messages.batch.mark_as_unseen( @@ -247,7 +227,6 @@ def test_method_mark_as_unseen(self, client: Knock) -> None: ) assert_matches_type(BatchMarkAsUnseenResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_unseen(self, client: Knock) -> None: response = client.messages.batch.with_raw_response.mark_as_unseen( @@ -259,7 +238,6 @@ def test_raw_response_mark_as_unseen(self, client: Knock) -> None: batch = response.parse() assert_matches_type(BatchMarkAsUnseenResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_unseen(self, client: Knock) -> None: with client.messages.batch.with_streaming_response.mark_as_unseen( @@ -273,7 +251,6 @@ def test_streaming_response_mark_as_unseen(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_unarchive(self, client: Knock) -> None: batch = client.messages.batch.unarchive( @@ -281,7 +258,6 @@ def test_method_unarchive(self, client: Knock) -> None: ) assert_matches_type(BatchUnarchiveResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_unarchive(self, client: Knock) -> None: response = client.messages.batch.with_raw_response.unarchive( @@ -293,7 +269,6 @@ def test_raw_response_unarchive(self, client: Knock) -> None: batch = response.parse() assert_matches_type(BatchUnarchiveResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_unarchive(self, client: Knock) -> None: with client.messages.batch.with_streaming_response.unarchive( @@ -313,7 +288,6 @@ class TestAsyncBatch: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_archive(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.archive( @@ -321,7 +295,6 @@ async def test_method_archive(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BatchArchiveResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_archive(self, async_client: AsyncKnock) -> None: response = await async_client.messages.batch.with_raw_response.archive( @@ -333,7 +306,6 @@ async def test_raw_response_archive(self, async_client: AsyncKnock) -> None: batch = await response.parse() assert_matches_type(BatchArchiveResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_archive(self, async_client: AsyncKnock) -> None: async with async_client.messages.batch.with_streaming_response.archive( @@ -347,7 +319,6 @@ async def test_streaming_response_archive(self, async_client: AsyncKnock) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_content(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.get_content( @@ -355,7 +326,6 @@ async def test_method_get_content(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BatchGetContentResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get_content(self, async_client: AsyncKnock) -> None: response = await async_client.messages.batch.with_raw_response.get_content( @@ -367,7 +337,6 @@ async def test_raw_response_get_content(self, async_client: AsyncKnock) -> None: batch = await response.parse() assert_matches_type(BatchGetContentResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get_content(self, async_client: AsyncKnock) -> None: async with async_client.messages.batch.with_streaming_response.get_content( @@ -381,7 +350,6 @@ async def test_streaming_response_get_content(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_interacted(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.mark_as_interacted( @@ -389,7 +357,6 @@ async def test_method_mark_as_interacted(self, async_client: AsyncKnock) -> None ) assert_matches_type(BatchMarkAsInteractedResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_interacted_with_all_params(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.mark_as_interacted( @@ -398,7 +365,6 @@ async def test_method_mark_as_interacted_with_all_params(self, async_client: Asy ) assert_matches_type(BatchMarkAsInteractedResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_interacted(self, async_client: AsyncKnock) -> None: response = await async_client.messages.batch.with_raw_response.mark_as_interacted( @@ -410,7 +376,6 @@ async def test_raw_response_mark_as_interacted(self, async_client: AsyncKnock) - batch = await response.parse() assert_matches_type(BatchMarkAsInteractedResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_interacted(self, async_client: AsyncKnock) -> None: async with async_client.messages.batch.with_streaming_response.mark_as_interacted( @@ -424,7 +389,6 @@ async def test_streaming_response_mark_as_interacted(self, async_client: AsyncKn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_read(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.mark_as_read( @@ -432,7 +396,6 @@ async def test_method_mark_as_read(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BatchMarkAsReadResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_read(self, async_client: AsyncKnock) -> None: response = await async_client.messages.batch.with_raw_response.mark_as_read( @@ -444,7 +407,6 @@ async def test_raw_response_mark_as_read(self, async_client: AsyncKnock) -> None batch = await response.parse() assert_matches_type(BatchMarkAsReadResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_read(self, async_client: AsyncKnock) -> None: async with async_client.messages.batch.with_streaming_response.mark_as_read( @@ -458,7 +420,6 @@ async def test_streaming_response_mark_as_read(self, async_client: AsyncKnock) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_seen(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.mark_as_seen( @@ -466,7 +427,6 @@ async def test_method_mark_as_seen(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BatchMarkAsSeenResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_seen(self, async_client: AsyncKnock) -> None: response = await async_client.messages.batch.with_raw_response.mark_as_seen( @@ -478,7 +438,6 @@ async def test_raw_response_mark_as_seen(self, async_client: AsyncKnock) -> None batch = await response.parse() assert_matches_type(BatchMarkAsSeenResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_seen(self, async_client: AsyncKnock) -> None: async with async_client.messages.batch.with_streaming_response.mark_as_seen( @@ -492,7 +451,6 @@ async def test_streaming_response_mark_as_seen(self, async_client: AsyncKnock) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_unread(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.mark_as_unread( @@ -500,7 +458,6 @@ async def test_method_mark_as_unread(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BatchMarkAsUnreadResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_unread(self, async_client: AsyncKnock) -> None: response = await async_client.messages.batch.with_raw_response.mark_as_unread( @@ -512,7 +469,6 @@ async def test_raw_response_mark_as_unread(self, async_client: AsyncKnock) -> No batch = await response.parse() assert_matches_type(BatchMarkAsUnreadResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_unread(self, async_client: AsyncKnock) -> None: async with async_client.messages.batch.with_streaming_response.mark_as_unread( @@ -526,7 +482,6 @@ async def test_streaming_response_mark_as_unread(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_unseen(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.mark_as_unseen( @@ -534,7 +489,6 @@ async def test_method_mark_as_unseen(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BatchMarkAsUnseenResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_unseen(self, async_client: AsyncKnock) -> None: response = await async_client.messages.batch.with_raw_response.mark_as_unseen( @@ -546,7 +500,6 @@ async def test_raw_response_mark_as_unseen(self, async_client: AsyncKnock) -> No batch = await response.parse() assert_matches_type(BatchMarkAsUnseenResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_unseen(self, async_client: AsyncKnock) -> None: async with async_client.messages.batch.with_streaming_response.mark_as_unseen( @@ -560,7 +513,6 @@ async def test_streaming_response_mark_as_unseen(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_unarchive(self, async_client: AsyncKnock) -> None: batch = await async_client.messages.batch.unarchive( @@ -568,7 +520,6 @@ async def test_method_unarchive(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BatchUnarchiveResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_unarchive(self, async_client: AsyncKnock) -> None: response = await async_client.messages.batch.with_raw_response.unarchive( @@ -580,7 +531,6 @@ async def test_raw_response_unarchive(self, async_client: AsyncKnock) -> None: batch = await response.parse() assert_matches_type(BatchUnarchiveResponse, batch, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_unarchive(self, async_client: AsyncKnock) -> None: async with async_client.messages.batch.with_streaming_response.unarchive( diff --git a/tests/api_resources/objects/test_bulk.py b/tests/api_resources/objects/test_bulk.py index 78e6c780..19e636c8 100644 --- a/tests/api_resources/objects/test_bulk.py +++ b/tests/api_resources/objects/test_bulk.py @@ -17,7 +17,6 @@ class TestBulk: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete(self, client: Knock) -> None: bulk = client.objects.bulk.delete( @@ -26,7 +25,6 @@ def test_method_delete(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete(self, client: Knock) -> None: response = client.objects.bulk.with_raw_response.delete( @@ -39,7 +37,6 @@ def test_raw_response_delete(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete(self, client: Knock) -> None: with client.objects.bulk.with_streaming_response.delete( @@ -54,7 +51,6 @@ def test_streaming_response_delete(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_delete(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -63,7 +59,6 @@ def test_path_params_delete(self, client: Knock) -> None: object_ids=["obj_123", "obj_456", "obj_789"], ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_add_subscriptions(self, client: Knock) -> None: bulk = client.objects.bulk.add_subscriptions( @@ -77,7 +72,6 @@ def test_method_add_subscriptions(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_add_subscriptions(self, client: Knock) -> None: response = client.objects.bulk.with_raw_response.add_subscriptions( @@ -95,7 +89,6 @@ def test_raw_response_add_subscriptions(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_add_subscriptions(self, client: Knock) -> None: with client.objects.bulk.with_streaming_response.add_subscriptions( @@ -115,7 +108,6 @@ def test_streaming_response_add_subscriptions(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_add_subscriptions(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -129,7 +121,6 @@ def test_path_params_add_subscriptions(self, client: Knock) -> None: ], ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete_subscriptions(self, client: Knock) -> None: bulk = client.objects.bulk.delete_subscriptions( @@ -147,7 +138,6 @@ def test_method_delete_subscriptions(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete_subscriptions(self, client: Knock) -> None: response = client.objects.bulk.with_raw_response.delete_subscriptions( @@ -169,7 +159,6 @@ def test_raw_response_delete_subscriptions(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete_subscriptions(self, client: Knock) -> None: with client.objects.bulk.with_streaming_response.delete_subscriptions( @@ -193,7 +182,6 @@ def test_streaming_response_delete_subscriptions(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_delete_subscriptions(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -211,7 +199,6 @@ def test_path_params_delete_subscriptions(self, client: Knock) -> None: ], ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set(self, client: Knock) -> None: bulk = client.objects.bulk.set( @@ -220,7 +207,6 @@ def test_method_set(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set(self, client: Knock) -> None: response = client.objects.bulk.with_raw_response.set( @@ -233,7 +219,6 @@ def test_raw_response_set(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set(self, client: Knock) -> None: with client.objects.bulk.with_streaming_response.set( @@ -248,7 +233,6 @@ def test_streaming_response_set(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_set(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -263,7 +247,6 @@ class TestAsyncBulk: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete(self, async_client: AsyncKnock) -> None: bulk = await async_client.objects.bulk.delete( @@ -272,7 +255,6 @@ async def test_method_delete(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: response = await async_client.objects.bulk.with_raw_response.delete( @@ -285,7 +267,6 @@ async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None: async with async_client.objects.bulk.with_streaming_response.delete( @@ -300,7 +281,6 @@ async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_delete(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -309,7 +289,6 @@ async def test_path_params_delete(self, async_client: AsyncKnock) -> None: object_ids=["obj_123", "obj_456", "obj_789"], ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_add_subscriptions(self, async_client: AsyncKnock) -> None: bulk = await async_client.objects.bulk.add_subscriptions( @@ -323,7 +302,6 @@ async def test_method_add_subscriptions(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_add_subscriptions(self, async_client: AsyncKnock) -> None: response = await async_client.objects.bulk.with_raw_response.add_subscriptions( @@ -341,7 +319,6 @@ async def test_raw_response_add_subscriptions(self, async_client: AsyncKnock) -> bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_add_subscriptions(self, async_client: AsyncKnock) -> None: async with async_client.objects.bulk.with_streaming_response.add_subscriptions( @@ -361,7 +338,6 @@ async def test_streaming_response_add_subscriptions(self, async_client: AsyncKno assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_add_subscriptions(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -375,7 +351,6 @@ async def test_path_params_add_subscriptions(self, async_client: AsyncKnock) -> ], ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete_subscriptions(self, async_client: AsyncKnock) -> None: bulk = await async_client.objects.bulk.delete_subscriptions( @@ -393,7 +368,6 @@ async def test_method_delete_subscriptions(self, async_client: AsyncKnock) -> No ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete_subscriptions(self, async_client: AsyncKnock) -> None: response = await async_client.objects.bulk.with_raw_response.delete_subscriptions( @@ -415,7 +389,6 @@ async def test_raw_response_delete_subscriptions(self, async_client: AsyncKnock) bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete_subscriptions(self, async_client: AsyncKnock) -> None: async with async_client.objects.bulk.with_streaming_response.delete_subscriptions( @@ -439,7 +412,6 @@ async def test_streaming_response_delete_subscriptions(self, async_client: Async assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_delete_subscriptions(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -457,7 +429,6 @@ async def test_path_params_delete_subscriptions(self, async_client: AsyncKnock) ], ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set(self, async_client: AsyncKnock) -> None: bulk = await async_client.objects.bulk.set( @@ -466,7 +437,6 @@ async def test_method_set(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set(self, async_client: AsyncKnock) -> None: response = await async_client.objects.bulk.with_raw_response.set( @@ -479,7 +449,6 @@ async def test_raw_response_set(self, async_client: AsyncKnock) -> None: bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set(self, async_client: AsyncKnock) -> None: async with async_client.objects.bulk.with_streaming_response.set( @@ -494,7 +463,6 @@ async def test_streaming_response_set(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_set(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): diff --git a/tests/api_resources/providers/test_ms_teams.py b/tests/api_resources/providers/test_ms_teams.py index 1a0f9cb1..eb8daf03 100644 --- a/tests/api_resources/providers/test_ms_teams.py +++ b/tests/api_resources/providers/test_ms_teams.py @@ -23,7 +23,6 @@ class TestMsTeams: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_check_auth(self, client: Knock) -> None: ms_team = client.providers.ms_teams.check_auth( @@ -32,7 +31,6 @@ def test_method_check_auth(self, client: Knock) -> None: ) assert_matches_type(MsTeamCheckAuthResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_check_auth(self, client: Knock) -> None: response = client.providers.ms_teams.with_raw_response.check_auth( @@ -45,7 +43,6 @@ def test_raw_response_check_auth(self, client: Knock) -> None: ms_team = response.parse() assert_matches_type(MsTeamCheckAuthResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_check_auth(self, client: Knock) -> None: with client.providers.ms_teams.with_streaming_response.check_auth( @@ -60,7 +57,6 @@ def test_streaming_response_check_auth(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_check_auth(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -69,7 +65,6 @@ def test_path_params_check_auth(self, client: Knock) -> None: ms_teams_tenant_object="ms_teams_tenant_object", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_channels(self, client: Knock) -> None: ms_team = client.providers.ms_teams.list_channels( @@ -79,7 +74,6 @@ def test_method_list_channels(self, client: Knock) -> None: ) assert_matches_type(MsTeamListChannelsResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_channels_with_all_params(self, client: Knock) -> None: ms_team = client.providers.ms_teams.list_channels( @@ -93,7 +87,6 @@ def test_method_list_channels_with_all_params(self, client: Knock) -> None: ) assert_matches_type(MsTeamListChannelsResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_channels(self, client: Knock) -> None: response = client.providers.ms_teams.with_raw_response.list_channels( @@ -107,7 +100,6 @@ def test_raw_response_list_channels(self, client: Knock) -> None: ms_team = response.parse() assert_matches_type(MsTeamListChannelsResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_channels(self, client: Knock) -> None: with client.providers.ms_teams.with_streaming_response.list_channels( @@ -123,7 +115,6 @@ def test_streaming_response_list_channels(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_channels(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -133,7 +124,6 @@ def test_path_params_list_channels(self, client: Knock) -> None: team_id="team_id", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_teams(self, client: Knock) -> None: ms_team = client.providers.ms_teams.list_teams( @@ -142,7 +132,6 @@ def test_method_list_teams(self, client: Knock) -> None: ) assert_matches_type(SyncMsTeamsPagination[MsTeamListTeamsResponse], ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_teams_with_all_params(self, client: Knock) -> None: ms_team = client.providers.ms_teams.list_teams( @@ -157,7 +146,6 @@ def test_method_list_teams_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncMsTeamsPagination[MsTeamListTeamsResponse], ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_teams(self, client: Knock) -> None: response = client.providers.ms_teams.with_raw_response.list_teams( @@ -170,7 +158,6 @@ def test_raw_response_list_teams(self, client: Knock) -> None: ms_team = response.parse() assert_matches_type(SyncMsTeamsPagination[MsTeamListTeamsResponse], ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_teams(self, client: Knock) -> None: with client.providers.ms_teams.with_streaming_response.list_teams( @@ -185,7 +172,6 @@ def test_streaming_response_list_teams(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_teams(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -194,7 +180,6 @@ def test_path_params_list_teams(self, client: Knock) -> None: ms_teams_tenant_object="ms_teams_tenant_object", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_revoke_access(self, client: Knock) -> None: ms_team = client.providers.ms_teams.revoke_access( @@ -203,7 +188,6 @@ def test_method_revoke_access(self, client: Knock) -> None: ) assert_matches_type(MsTeamRevokeAccessResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_revoke_access(self, client: Knock) -> None: response = client.providers.ms_teams.with_raw_response.revoke_access( @@ -216,7 +200,6 @@ def test_raw_response_revoke_access(self, client: Knock) -> None: ms_team = response.parse() assert_matches_type(MsTeamRevokeAccessResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_revoke_access(self, client: Knock) -> None: with client.providers.ms_teams.with_streaming_response.revoke_access( @@ -231,7 +214,6 @@ def test_streaming_response_revoke_access(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_revoke_access(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -246,7 +228,6 @@ class TestAsyncMsTeams: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_check_auth(self, async_client: AsyncKnock) -> None: ms_team = await async_client.providers.ms_teams.check_auth( @@ -255,7 +236,6 @@ async def test_method_check_auth(self, async_client: AsyncKnock) -> None: ) assert_matches_type(MsTeamCheckAuthResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_check_auth(self, async_client: AsyncKnock) -> None: response = await async_client.providers.ms_teams.with_raw_response.check_auth( @@ -268,7 +248,6 @@ async def test_raw_response_check_auth(self, async_client: AsyncKnock) -> None: ms_team = await response.parse() assert_matches_type(MsTeamCheckAuthResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_check_auth(self, async_client: AsyncKnock) -> None: async with async_client.providers.ms_teams.with_streaming_response.check_auth( @@ -283,7 +262,6 @@ async def test_streaming_response_check_auth(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_check_auth(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -292,7 +270,6 @@ async def test_path_params_check_auth(self, async_client: AsyncKnock) -> None: ms_teams_tenant_object="ms_teams_tenant_object", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_channels(self, async_client: AsyncKnock) -> None: ms_team = await async_client.providers.ms_teams.list_channels( @@ -302,7 +279,6 @@ async def test_method_list_channels(self, async_client: AsyncKnock) -> None: ) assert_matches_type(MsTeamListChannelsResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_channels_with_all_params(self, async_client: AsyncKnock) -> None: ms_team = await async_client.providers.ms_teams.list_channels( @@ -316,7 +292,6 @@ async def test_method_list_channels_with_all_params(self, async_client: AsyncKno ) assert_matches_type(MsTeamListChannelsResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_channels(self, async_client: AsyncKnock) -> None: response = await async_client.providers.ms_teams.with_raw_response.list_channels( @@ -330,7 +305,6 @@ async def test_raw_response_list_channels(self, async_client: AsyncKnock) -> Non ms_team = await response.parse() assert_matches_type(MsTeamListChannelsResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_channels(self, async_client: AsyncKnock) -> None: async with async_client.providers.ms_teams.with_streaming_response.list_channels( @@ -346,7 +320,6 @@ async def test_streaming_response_list_channels(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_channels(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -356,7 +329,6 @@ async def test_path_params_list_channels(self, async_client: AsyncKnock) -> None team_id="team_id", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_teams(self, async_client: AsyncKnock) -> None: ms_team = await async_client.providers.ms_teams.list_teams( @@ -365,7 +337,6 @@ async def test_method_list_teams(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncMsTeamsPagination[MsTeamListTeamsResponse], ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_teams_with_all_params(self, async_client: AsyncKnock) -> None: ms_team = await async_client.providers.ms_teams.list_teams( @@ -380,7 +351,6 @@ async def test_method_list_teams_with_all_params(self, async_client: AsyncKnock) ) assert_matches_type(AsyncMsTeamsPagination[MsTeamListTeamsResponse], ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_teams(self, async_client: AsyncKnock) -> None: response = await async_client.providers.ms_teams.with_raw_response.list_teams( @@ -393,7 +363,6 @@ async def test_raw_response_list_teams(self, async_client: AsyncKnock) -> None: ms_team = await response.parse() assert_matches_type(AsyncMsTeamsPagination[MsTeamListTeamsResponse], ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_teams(self, async_client: AsyncKnock) -> None: async with async_client.providers.ms_teams.with_streaming_response.list_teams( @@ -408,7 +377,6 @@ async def test_streaming_response_list_teams(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_teams(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -417,7 +385,6 @@ async def test_path_params_list_teams(self, async_client: AsyncKnock) -> None: ms_teams_tenant_object="ms_teams_tenant_object", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_revoke_access(self, async_client: AsyncKnock) -> None: ms_team = await async_client.providers.ms_teams.revoke_access( @@ -426,7 +393,6 @@ async def test_method_revoke_access(self, async_client: AsyncKnock) -> None: ) assert_matches_type(MsTeamRevokeAccessResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_revoke_access(self, async_client: AsyncKnock) -> None: response = await async_client.providers.ms_teams.with_raw_response.revoke_access( @@ -439,7 +405,6 @@ async def test_raw_response_revoke_access(self, async_client: AsyncKnock) -> Non ms_team = await response.parse() assert_matches_type(MsTeamRevokeAccessResponse, ms_team, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_revoke_access(self, async_client: AsyncKnock) -> None: async with async_client.providers.ms_teams.with_streaming_response.revoke_access( @@ -454,7 +419,6 @@ async def test_streaming_response_revoke_access(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_revoke_access(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): diff --git a/tests/api_resources/providers/test_slack.py b/tests/api_resources/providers/test_slack.py index a0e993d8..fd85e507 100644 --- a/tests/api_resources/providers/test_slack.py +++ b/tests/api_resources/providers/test_slack.py @@ -22,7 +22,6 @@ class TestSlack: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_check_auth(self, client: Knock) -> None: slack = client.providers.slack.check_auth( @@ -31,7 +30,6 @@ def test_method_check_auth(self, client: Knock) -> None: ) assert_matches_type(SlackCheckAuthResponse, slack, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_check_auth(self, client: Knock) -> None: response = client.providers.slack.with_raw_response.check_auth( @@ -44,7 +42,6 @@ def test_raw_response_check_auth(self, client: Knock) -> None: slack = response.parse() assert_matches_type(SlackCheckAuthResponse, slack, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_check_auth(self, client: Knock) -> None: with client.providers.slack.with_streaming_response.check_auth( @@ -59,7 +56,6 @@ def test_streaming_response_check_auth(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_check_auth(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -68,7 +64,6 @@ def test_path_params_check_auth(self, client: Knock) -> None: access_token_object="access_token_object", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_channels(self, client: Knock) -> None: slack = client.providers.slack.list_channels( @@ -77,7 +72,6 @@ def test_method_list_channels(self, client: Knock) -> None: ) assert_matches_type(SyncSlackChannelsCursor[SlackListChannelsResponse], slack, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_channels_with_all_params(self, client: Knock) -> None: slack = client.providers.slack.list_channels( @@ -93,7 +87,6 @@ def test_method_list_channels_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncSlackChannelsCursor[SlackListChannelsResponse], slack, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_channels(self, client: Knock) -> None: response = client.providers.slack.with_raw_response.list_channels( @@ -106,7 +99,6 @@ def test_raw_response_list_channels(self, client: Knock) -> None: slack = response.parse() assert_matches_type(SyncSlackChannelsCursor[SlackListChannelsResponse], slack, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_channels(self, client: Knock) -> None: with client.providers.slack.with_streaming_response.list_channels( @@ -121,7 +113,6 @@ def test_streaming_response_list_channels(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_channels(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -130,7 +121,6 @@ def test_path_params_list_channels(self, client: Knock) -> None: access_token_object="access_token_object", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_revoke_access(self, client: Knock) -> None: slack = client.providers.slack.revoke_access( @@ -139,7 +129,6 @@ def test_method_revoke_access(self, client: Knock) -> None: ) assert_matches_type(SlackRevokeAccessResponse, slack, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_revoke_access(self, client: Knock) -> None: response = client.providers.slack.with_raw_response.revoke_access( @@ -152,7 +141,6 @@ def test_raw_response_revoke_access(self, client: Knock) -> None: slack = response.parse() assert_matches_type(SlackRevokeAccessResponse, slack, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_revoke_access(self, client: Knock) -> None: with client.providers.slack.with_streaming_response.revoke_access( @@ -167,7 +155,6 @@ def test_streaming_response_revoke_access(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_revoke_access(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -182,7 +169,6 @@ class TestAsyncSlack: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_check_auth(self, async_client: AsyncKnock) -> None: slack = await async_client.providers.slack.check_auth( @@ -191,7 +177,6 @@ async def test_method_check_auth(self, async_client: AsyncKnock) -> None: ) assert_matches_type(SlackCheckAuthResponse, slack, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_check_auth(self, async_client: AsyncKnock) -> None: response = await async_client.providers.slack.with_raw_response.check_auth( @@ -204,7 +189,6 @@ async def test_raw_response_check_auth(self, async_client: AsyncKnock) -> None: slack = await response.parse() assert_matches_type(SlackCheckAuthResponse, slack, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_check_auth(self, async_client: AsyncKnock) -> None: async with async_client.providers.slack.with_streaming_response.check_auth( @@ -219,7 +203,6 @@ async def test_streaming_response_check_auth(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_check_auth(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -228,7 +211,6 @@ async def test_path_params_check_auth(self, async_client: AsyncKnock) -> None: access_token_object="access_token_object", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_channels(self, async_client: AsyncKnock) -> None: slack = await async_client.providers.slack.list_channels( @@ -237,7 +219,6 @@ async def test_method_list_channels(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncSlackChannelsCursor[SlackListChannelsResponse], slack, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_channels_with_all_params(self, async_client: AsyncKnock) -> None: slack = await async_client.providers.slack.list_channels( @@ -253,7 +234,6 @@ async def test_method_list_channels_with_all_params(self, async_client: AsyncKno ) assert_matches_type(AsyncSlackChannelsCursor[SlackListChannelsResponse], slack, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_channels(self, async_client: AsyncKnock) -> None: response = await async_client.providers.slack.with_raw_response.list_channels( @@ -266,7 +246,6 @@ async def test_raw_response_list_channels(self, async_client: AsyncKnock) -> Non slack = await response.parse() assert_matches_type(AsyncSlackChannelsCursor[SlackListChannelsResponse], slack, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_channels(self, async_client: AsyncKnock) -> None: async with async_client.providers.slack.with_streaming_response.list_channels( @@ -281,7 +260,6 @@ async def test_streaming_response_list_channels(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_channels(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): @@ -290,7 +268,6 @@ async def test_path_params_list_channels(self, async_client: AsyncKnock) -> None access_token_object="access_token_object", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_revoke_access(self, async_client: AsyncKnock) -> None: slack = await async_client.providers.slack.revoke_access( @@ -299,7 +276,6 @@ async def test_method_revoke_access(self, async_client: AsyncKnock) -> None: ) assert_matches_type(SlackRevokeAccessResponse, slack, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_revoke_access(self, async_client: AsyncKnock) -> None: response = await async_client.providers.slack.with_raw_response.revoke_access( @@ -312,7 +288,6 @@ async def test_raw_response_revoke_access(self, async_client: AsyncKnock) -> Non slack = await response.parse() assert_matches_type(SlackRevokeAccessResponse, slack, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_revoke_access(self, async_client: AsyncKnock) -> None: async with async_client.providers.slack.with_streaming_response.revoke_access( @@ -327,7 +302,6 @@ async def test_streaming_response_revoke_access(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_revoke_access(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `channel_id` but received ''"): diff --git a/tests/api_resources/schedules/test_bulk.py b/tests/api_resources/schedules/test_bulk.py index d2426efc..93076263 100644 --- a/tests/api_resources/schedules/test_bulk.py +++ b/tests/api_resources/schedules/test_bulk.py @@ -17,7 +17,6 @@ class TestBulk: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_create(self, client: Knock) -> None: bulk = client.schedules.bulk.create( @@ -25,7 +24,6 @@ def test_method_create(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_create(self, client: Knock) -> None: response = client.schedules.bulk.with_raw_response.create( @@ -37,7 +35,6 @@ def test_raw_response_create(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_create(self, client: Knock) -> None: with client.schedules.bulk.with_streaming_response.create( @@ -57,7 +54,6 @@ class TestAsyncBulk: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_create(self, async_client: AsyncKnock) -> None: bulk = await async_client.schedules.bulk.create( @@ -65,7 +61,6 @@ async def test_method_create(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_create(self, async_client: AsyncKnock) -> None: response = await async_client.schedules.bulk.with_raw_response.create( @@ -77,7 +72,6 @@ async def test_raw_response_create(self, async_client: AsyncKnock) -> None: bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_create(self, async_client: AsyncKnock) -> None: async with async_client.schedules.bulk.with_streaming_response.create( diff --git a/tests/api_resources/tenants/test_bulk.py b/tests/api_resources/tenants/test_bulk.py index 22096bea..4be66969 100644 --- a/tests/api_resources/tenants/test_bulk.py +++ b/tests/api_resources/tenants/test_bulk.py @@ -17,7 +17,6 @@ class TestBulk: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete(self, client: Knock) -> None: bulk = client.tenants.bulk.delete( @@ -25,7 +24,6 @@ def test_method_delete(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete(self, client: Knock) -> None: response = client.tenants.bulk.with_raw_response.delete( @@ -37,7 +35,6 @@ def test_raw_response_delete(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete(self, client: Knock) -> None: with client.tenants.bulk.with_streaming_response.delete( @@ -51,7 +48,6 @@ def test_streaming_response_delete(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set(self, client: Knock) -> None: bulk = client.tenants.bulk.set( @@ -59,7 +55,6 @@ def test_method_set(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set(self, client: Knock) -> None: response = client.tenants.bulk.with_raw_response.set( @@ -71,7 +66,6 @@ def test_raw_response_set(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set(self, client: Knock) -> None: with client.tenants.bulk.with_streaming_response.set( @@ -91,7 +85,6 @@ class TestAsyncBulk: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete(self, async_client: AsyncKnock) -> None: bulk = await async_client.tenants.bulk.delete( @@ -99,7 +92,6 @@ async def test_method_delete(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: response = await async_client.tenants.bulk.with_raw_response.delete( @@ -111,7 +103,6 @@ async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None: async with async_client.tenants.bulk.with_streaming_response.delete( @@ -125,7 +116,6 @@ async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set(self, async_client: AsyncKnock) -> None: bulk = await async_client.tenants.bulk.set( @@ -133,7 +123,6 @@ async def test_method_set(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set(self, async_client: AsyncKnock) -> None: response = await async_client.tenants.bulk.with_raw_response.set( @@ -145,7 +134,6 @@ async def test_raw_response_set(self, async_client: AsyncKnock) -> None: bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set(self, async_client: AsyncKnock) -> None: async with async_client.tenants.bulk.with_streaming_response.set( diff --git a/tests/api_resources/test_audiences.py b/tests/api_resources/test_audiences.py index 26dcb10e..15b506a4 100644 --- a/tests/api_resources/test_audiences.py +++ b/tests/api_resources/test_audiences.py @@ -18,7 +18,6 @@ class TestAudiences: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_add_members(self, client: Knock) -> None: audience = client.audiences.add_members( @@ -27,7 +26,6 @@ def test_method_add_members(self, client: Knock) -> None: ) assert audience is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_add_members_with_all_params(self, client: Knock) -> None: audience = client.audiences.add_members( @@ -143,7 +141,6 @@ def test_method_add_members_with_all_params(self, client: Knock) -> None: ) assert audience is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_add_members(self, client: Knock) -> None: response = client.audiences.with_raw_response.add_members( @@ -156,7 +153,6 @@ def test_raw_response_add_members(self, client: Knock) -> None: audience = response.parse() assert audience is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_add_members(self, client: Knock) -> None: with client.audiences.with_streaming_response.add_members( @@ -171,7 +167,6 @@ def test_streaming_response_add_members(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_add_members(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): @@ -180,7 +175,6 @@ def test_path_params_add_members(self, client: Knock) -> None: members=[{"user": {"id": "dr_sattler"}}], ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_members(self, client: Knock) -> None: audience = client.audiences.list_members( @@ -188,7 +182,6 @@ def test_method_list_members(self, client: Knock) -> None: ) assert_matches_type(AudienceListMembersResponse, audience, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_members(self, client: Knock) -> None: response = client.audiences.with_raw_response.list_members( @@ -200,7 +193,6 @@ def test_raw_response_list_members(self, client: Knock) -> None: audience = response.parse() assert_matches_type(AudienceListMembersResponse, audience, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_members(self, client: Knock) -> None: with client.audiences.with_streaming_response.list_members( @@ -214,7 +206,6 @@ def test_streaming_response_list_members(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_members(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): @@ -222,7 +213,6 @@ def test_path_params_list_members(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_remove_members(self, client: Knock) -> None: audience = client.audiences.remove_members( @@ -231,7 +221,6 @@ def test_method_remove_members(self, client: Knock) -> None: ) assert audience is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_remove_members(self, client: Knock) -> None: response = client.audiences.with_raw_response.remove_members( @@ -244,7 +233,6 @@ def test_raw_response_remove_members(self, client: Knock) -> None: audience = response.parse() assert audience is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_remove_members(self, client: Knock) -> None: with client.audiences.with_streaming_response.remove_members( @@ -259,7 +247,6 @@ def test_streaming_response_remove_members(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_remove_members(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): @@ -274,7 +261,6 @@ class TestAsyncAudiences: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_add_members(self, async_client: AsyncKnock) -> None: audience = await async_client.audiences.add_members( @@ -283,7 +269,6 @@ async def test_method_add_members(self, async_client: AsyncKnock) -> None: ) assert audience is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_add_members_with_all_params(self, async_client: AsyncKnock) -> None: audience = await async_client.audiences.add_members( @@ -399,7 +384,6 @@ async def test_method_add_members_with_all_params(self, async_client: AsyncKnock ) assert audience is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_add_members(self, async_client: AsyncKnock) -> None: response = await async_client.audiences.with_raw_response.add_members( @@ -412,7 +396,6 @@ async def test_raw_response_add_members(self, async_client: AsyncKnock) -> None: audience = await response.parse() assert audience is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_add_members(self, async_client: AsyncKnock) -> None: async with async_client.audiences.with_streaming_response.add_members( @@ -427,7 +410,6 @@ async def test_streaming_response_add_members(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_add_members(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): @@ -436,7 +418,6 @@ async def test_path_params_add_members(self, async_client: AsyncKnock) -> None: members=[{"user": {"id": "dr_sattler"}}], ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_members(self, async_client: AsyncKnock) -> None: audience = await async_client.audiences.list_members( @@ -444,7 +425,6 @@ async def test_method_list_members(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AudienceListMembersResponse, audience, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_members(self, async_client: AsyncKnock) -> None: response = await async_client.audiences.with_raw_response.list_members( @@ -456,7 +436,6 @@ async def test_raw_response_list_members(self, async_client: AsyncKnock) -> None audience = await response.parse() assert_matches_type(AudienceListMembersResponse, audience, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_members(self, async_client: AsyncKnock) -> None: async with async_client.audiences.with_streaming_response.list_members( @@ -470,7 +449,6 @@ async def test_streaming_response_list_members(self, async_client: AsyncKnock) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_members(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): @@ -478,7 +456,6 @@ async def test_path_params_list_members(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_remove_members(self, async_client: AsyncKnock) -> None: audience = await async_client.audiences.remove_members( @@ -487,7 +464,6 @@ async def test_method_remove_members(self, async_client: AsyncKnock) -> None: ) assert audience is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_remove_members(self, async_client: AsyncKnock) -> None: response = await async_client.audiences.with_raw_response.remove_members( @@ -500,7 +476,6 @@ async def test_raw_response_remove_members(self, async_client: AsyncKnock) -> No audience = await response.parse() assert audience is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_remove_members(self, async_client: AsyncKnock) -> None: async with async_client.audiences.with_streaming_response.remove_members( @@ -515,7 +490,6 @@ async def test_streaming_response_remove_members(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_remove_members(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): diff --git a/tests/api_resources/test_bulk_operations.py b/tests/api_resources/test_bulk_operations.py index a38e091b..2b764216 100644 --- a/tests/api_resources/test_bulk_operations.py +++ b/tests/api_resources/test_bulk_operations.py @@ -17,7 +17,6 @@ class TestBulkOperations: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get(self, client: Knock) -> None: bulk_operation = client.bulk_operations.get( @@ -25,7 +24,6 @@ def test_method_get(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk_operation, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get(self, client: Knock) -> None: response = client.bulk_operations.with_raw_response.get( @@ -37,7 +35,6 @@ def test_raw_response_get(self, client: Knock) -> None: bulk_operation = response.parse() assert_matches_type(BulkOperation, bulk_operation, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get(self, client: Knock) -> None: with client.bulk_operations.with_streaming_response.get( @@ -51,7 +48,6 @@ def test_streaming_response_get(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): @@ -65,7 +61,6 @@ class TestAsyncBulkOperations: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get(self, async_client: AsyncKnock) -> None: bulk_operation = await async_client.bulk_operations.get( @@ -73,7 +68,6 @@ async def test_method_get(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk_operation, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get(self, async_client: AsyncKnock) -> None: response = await async_client.bulk_operations.with_raw_response.get( @@ -85,7 +79,6 @@ async def test_raw_response_get(self, async_client: AsyncKnock) -> None: bulk_operation = await response.parse() assert_matches_type(BulkOperation, bulk_operation, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: async with async_client.bulk_operations.with_streaming_response.get( @@ -99,7 +92,6 @@ async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): diff --git a/tests/api_resources/test_messages.py b/tests/api_resources/test_messages.py index 3225f70f..79f9ddd0 100644 --- a/tests/api_resources/test_messages.py +++ b/tests/api_resources/test_messages.py @@ -24,13 +24,11 @@ class TestMessages: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list(self, client: Knock) -> None: message = client.messages.list() assert_matches_type(SyncItemsCursor[Message], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_with_all_params(self, client: Knock) -> None: message = client.messages.list( @@ -56,7 +54,6 @@ def test_method_list_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[Message], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list(self, client: Knock) -> None: response = client.messages.with_raw_response.list() @@ -66,7 +63,6 @@ def test_raw_response_list(self, client: Knock) -> None: message = response.parse() assert_matches_type(SyncItemsCursor[Message], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list(self, client: Knock) -> None: with client.messages.with_streaming_response.list() as response: @@ -78,7 +74,6 @@ def test_streaming_response_list(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_archive(self, client: Knock) -> None: message = client.messages.archive( @@ -86,7 +81,6 @@ def test_method_archive(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_archive(self, client: Knock) -> None: response = client.messages.with_raw_response.archive( @@ -98,7 +92,6 @@ def test_raw_response_archive(self, client: Knock) -> None: message = response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_archive(self, client: Knock) -> None: with client.messages.with_streaming_response.archive( @@ -112,7 +105,6 @@ def test_streaming_response_archive(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_archive(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -120,7 +112,6 @@ def test_path_params_archive(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get(self, client: Knock) -> None: message = client.messages.get( @@ -128,7 +119,6 @@ def test_method_get(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get(self, client: Knock) -> None: response = client.messages.with_raw_response.get( @@ -140,7 +130,6 @@ def test_raw_response_get(self, client: Knock) -> None: message = response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get(self, client: Knock) -> None: with client.messages.with_streaming_response.get( @@ -154,7 +143,6 @@ def test_streaming_response_get(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -162,7 +150,6 @@ def test_path_params_get(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_content(self, client: Knock) -> None: message = client.messages.get_content( @@ -170,7 +157,6 @@ def test_method_get_content(self, client: Knock) -> None: ) assert_matches_type(MessageGetContentResponse, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get_content(self, client: Knock) -> None: response = client.messages.with_raw_response.get_content( @@ -182,7 +168,6 @@ def test_raw_response_get_content(self, client: Knock) -> None: message = response.parse() assert_matches_type(MessageGetContentResponse, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get_content(self, client: Knock) -> None: with client.messages.with_streaming_response.get_content( @@ -196,7 +181,6 @@ def test_streaming_response_get_content(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get_content(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -204,7 +188,6 @@ def test_path_params_get_content(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_activities(self, client: Knock) -> None: message = client.messages.list_activities( @@ -212,7 +195,6 @@ def test_method_list_activities(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[Activity], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_activities_with_all_params(self, client: Knock) -> None: message = client.messages.list_activities( @@ -224,7 +206,6 @@ def test_method_list_activities_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[Activity], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_activities(self, client: Knock) -> None: response = client.messages.with_raw_response.list_activities( @@ -236,7 +217,6 @@ def test_raw_response_list_activities(self, client: Knock) -> None: message = response.parse() assert_matches_type(SyncItemsCursor[Activity], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_activities(self, client: Knock) -> None: with client.messages.with_streaming_response.list_activities( @@ -250,7 +230,6 @@ def test_streaming_response_list_activities(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_activities(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -258,7 +237,6 @@ def test_path_params_list_activities(self, client: Knock) -> None: message_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_delivery_logs(self, client: Knock) -> None: message = client.messages.list_delivery_logs( @@ -266,7 +244,6 @@ def test_method_list_delivery_logs(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[MessageDeliveryLog], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_delivery_logs_with_all_params(self, client: Knock) -> None: message = client.messages.list_delivery_logs( @@ -277,7 +254,6 @@ def test_method_list_delivery_logs_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[MessageDeliveryLog], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_delivery_logs(self, client: Knock) -> None: response = client.messages.with_raw_response.list_delivery_logs( @@ -289,7 +265,6 @@ def test_raw_response_list_delivery_logs(self, client: Knock) -> None: message = response.parse() assert_matches_type(SyncItemsCursor[MessageDeliveryLog], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_delivery_logs(self, client: Knock) -> None: with client.messages.with_streaming_response.list_delivery_logs( @@ -303,7 +278,6 @@ def test_streaming_response_list_delivery_logs(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_delivery_logs(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -311,7 +285,6 @@ def test_path_params_list_delivery_logs(self, client: Knock) -> None: message_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_events(self, client: Knock) -> None: message = client.messages.list_events( @@ -319,7 +292,6 @@ def test_method_list_events(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[MessageEvent], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_events_with_all_params(self, client: Knock) -> None: message = client.messages.list_events( @@ -330,7 +302,6 @@ def test_method_list_events_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[MessageEvent], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_events(self, client: Knock) -> None: response = client.messages.with_raw_response.list_events( @@ -342,7 +313,6 @@ def test_raw_response_list_events(self, client: Knock) -> None: message = response.parse() assert_matches_type(SyncItemsCursor[MessageEvent], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_events(self, client: Knock) -> None: with client.messages.with_streaming_response.list_events( @@ -356,7 +326,6 @@ def test_streaming_response_list_events(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_events(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -364,7 +333,6 @@ def test_path_params_list_events(self, client: Knock) -> None: message_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_interacted(self, client: Knock) -> None: message = client.messages.mark_as_interacted( @@ -372,7 +340,6 @@ def test_method_mark_as_interacted(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_interacted_with_all_params(self, client: Knock) -> None: message = client.messages.mark_as_interacted( @@ -381,7 +348,6 @@ def test_method_mark_as_interacted_with_all_params(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_interacted(self, client: Knock) -> None: response = client.messages.with_raw_response.mark_as_interacted( @@ -393,7 +359,6 @@ def test_raw_response_mark_as_interacted(self, client: Knock) -> None: message = response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_interacted(self, client: Knock) -> None: with client.messages.with_streaming_response.mark_as_interacted( @@ -407,7 +372,6 @@ def test_streaming_response_mark_as_interacted(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_mark_as_interacted(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -415,7 +379,6 @@ def test_path_params_mark_as_interacted(self, client: Knock) -> None: message_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_read(self, client: Knock) -> None: message = client.messages.mark_as_read( @@ -423,7 +386,6 @@ def test_method_mark_as_read(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_read(self, client: Knock) -> None: response = client.messages.with_raw_response.mark_as_read( @@ -435,7 +397,6 @@ def test_raw_response_mark_as_read(self, client: Knock) -> None: message = response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_read(self, client: Knock) -> None: with client.messages.with_streaming_response.mark_as_read( @@ -449,7 +410,6 @@ def test_streaming_response_mark_as_read(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_mark_as_read(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -457,7 +417,6 @@ def test_path_params_mark_as_read(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_seen(self, client: Knock) -> None: message = client.messages.mark_as_seen( @@ -465,7 +424,6 @@ def test_method_mark_as_seen(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_seen(self, client: Knock) -> None: response = client.messages.with_raw_response.mark_as_seen( @@ -477,7 +435,6 @@ def test_raw_response_mark_as_seen(self, client: Knock) -> None: message = response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_seen(self, client: Knock) -> None: with client.messages.with_streaming_response.mark_as_seen( @@ -491,7 +448,6 @@ def test_streaming_response_mark_as_seen(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_mark_as_seen(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -499,7 +455,6 @@ def test_path_params_mark_as_seen(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_unread(self, client: Knock) -> None: message = client.messages.mark_as_unread( @@ -507,7 +462,6 @@ def test_method_mark_as_unread(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_unread(self, client: Knock) -> None: response = client.messages.with_raw_response.mark_as_unread( @@ -519,7 +473,6 @@ def test_raw_response_mark_as_unread(self, client: Knock) -> None: message = response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_unread(self, client: Knock) -> None: with client.messages.with_streaming_response.mark_as_unread( @@ -533,7 +486,6 @@ def test_streaming_response_mark_as_unread(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_mark_as_unread(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -541,7 +493,6 @@ def test_path_params_mark_as_unread(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_as_unseen(self, client: Knock) -> None: message = client.messages.mark_as_unseen( @@ -549,7 +500,6 @@ def test_method_mark_as_unseen(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_as_unseen(self, client: Knock) -> None: response = client.messages.with_raw_response.mark_as_unseen( @@ -561,7 +511,6 @@ def test_raw_response_mark_as_unseen(self, client: Knock) -> None: message = response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_as_unseen(self, client: Knock) -> None: with client.messages.with_streaming_response.mark_as_unseen( @@ -575,7 +524,6 @@ def test_streaming_response_mark_as_unseen(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_mark_as_unseen(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -583,7 +531,6 @@ def test_path_params_mark_as_unseen(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_unarchive(self, client: Knock) -> None: message = client.messages.unarchive( @@ -591,7 +538,6 @@ def test_method_unarchive(self, client: Knock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_unarchive(self, client: Knock) -> None: response = client.messages.with_raw_response.unarchive( @@ -603,7 +549,6 @@ def test_raw_response_unarchive(self, client: Knock) -> None: message = response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_unarchive(self, client: Knock) -> None: with client.messages.with_streaming_response.unarchive( @@ -617,7 +562,6 @@ def test_streaming_response_unarchive(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_unarchive(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -631,13 +575,11 @@ class TestAsyncMessages: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list(self, async_client: AsyncKnock) -> None: message = await async_client.messages.list() assert_matches_type(AsyncItemsCursor[Message], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> None: message = await async_client.messages.list( @@ -663,7 +605,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> No ) assert_matches_type(AsyncItemsCursor[Message], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.list() @@ -673,7 +614,6 @@ async def test_raw_response_list(self, async_client: AsyncKnock) -> None: message = await response.parse() assert_matches_type(AsyncItemsCursor[Message], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.list() as response: @@ -685,7 +625,6 @@ async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_archive(self, async_client: AsyncKnock) -> None: message = await async_client.messages.archive( @@ -693,7 +632,6 @@ async def test_method_archive(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_archive(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.archive( @@ -705,7 +643,6 @@ async def test_raw_response_archive(self, async_client: AsyncKnock) -> None: message = await response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_archive(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.archive( @@ -719,7 +656,6 @@ async def test_streaming_response_archive(self, async_client: AsyncKnock) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_archive(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -727,7 +663,6 @@ async def test_path_params_archive(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get(self, async_client: AsyncKnock) -> None: message = await async_client.messages.get( @@ -735,7 +670,6 @@ async def test_method_get(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.get( @@ -747,7 +681,6 @@ async def test_raw_response_get(self, async_client: AsyncKnock) -> None: message = await response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.get( @@ -761,7 +694,6 @@ async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -769,7 +701,6 @@ async def test_path_params_get(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_content(self, async_client: AsyncKnock) -> None: message = await async_client.messages.get_content( @@ -777,7 +708,6 @@ async def test_method_get_content(self, async_client: AsyncKnock) -> None: ) assert_matches_type(MessageGetContentResponse, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get_content(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.get_content( @@ -789,7 +719,6 @@ async def test_raw_response_get_content(self, async_client: AsyncKnock) -> None: message = await response.parse() assert_matches_type(MessageGetContentResponse, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get_content(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.get_content( @@ -803,7 +732,6 @@ async def test_streaming_response_get_content(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get_content(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -811,7 +739,6 @@ async def test_path_params_get_content(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_activities(self, async_client: AsyncKnock) -> None: message = await async_client.messages.list_activities( @@ -819,7 +746,6 @@ async def test_method_list_activities(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncItemsCursor[Activity], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_activities_with_all_params(self, async_client: AsyncKnock) -> None: message = await async_client.messages.list_activities( @@ -831,7 +757,6 @@ async def test_method_list_activities_with_all_params(self, async_client: AsyncK ) assert_matches_type(AsyncItemsCursor[Activity], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_activities(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.list_activities( @@ -843,7 +768,6 @@ async def test_raw_response_list_activities(self, async_client: AsyncKnock) -> N message = await response.parse() assert_matches_type(AsyncItemsCursor[Activity], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_activities(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.list_activities( @@ -857,7 +781,6 @@ async def test_streaming_response_list_activities(self, async_client: AsyncKnock assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_activities(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -865,7 +788,6 @@ async def test_path_params_list_activities(self, async_client: AsyncKnock) -> No message_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_delivery_logs(self, async_client: AsyncKnock) -> None: message = await async_client.messages.list_delivery_logs( @@ -873,7 +795,6 @@ async def test_method_list_delivery_logs(self, async_client: AsyncKnock) -> None ) assert_matches_type(AsyncItemsCursor[MessageDeliveryLog], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_delivery_logs_with_all_params(self, async_client: AsyncKnock) -> None: message = await async_client.messages.list_delivery_logs( @@ -884,7 +805,6 @@ async def test_method_list_delivery_logs_with_all_params(self, async_client: Asy ) assert_matches_type(AsyncItemsCursor[MessageDeliveryLog], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_delivery_logs(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.list_delivery_logs( @@ -896,7 +816,6 @@ async def test_raw_response_list_delivery_logs(self, async_client: AsyncKnock) - message = await response.parse() assert_matches_type(AsyncItemsCursor[MessageDeliveryLog], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_delivery_logs(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.list_delivery_logs( @@ -910,7 +829,6 @@ async def test_streaming_response_list_delivery_logs(self, async_client: AsyncKn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_delivery_logs(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -918,7 +836,6 @@ async def test_path_params_list_delivery_logs(self, async_client: AsyncKnock) -> message_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_events(self, async_client: AsyncKnock) -> None: message = await async_client.messages.list_events( @@ -926,7 +843,6 @@ async def test_method_list_events(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncItemsCursor[MessageEvent], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_events_with_all_params(self, async_client: AsyncKnock) -> None: message = await async_client.messages.list_events( @@ -937,7 +853,6 @@ async def test_method_list_events_with_all_params(self, async_client: AsyncKnock ) assert_matches_type(AsyncItemsCursor[MessageEvent], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_events(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.list_events( @@ -949,7 +864,6 @@ async def test_raw_response_list_events(self, async_client: AsyncKnock) -> None: message = await response.parse() assert_matches_type(AsyncItemsCursor[MessageEvent], message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_events(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.list_events( @@ -963,7 +877,6 @@ async def test_streaming_response_list_events(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_events(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -971,7 +884,6 @@ async def test_path_params_list_events(self, async_client: AsyncKnock) -> None: message_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_interacted(self, async_client: AsyncKnock) -> None: message = await async_client.messages.mark_as_interacted( @@ -979,7 +891,6 @@ async def test_method_mark_as_interacted(self, async_client: AsyncKnock) -> None ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_interacted_with_all_params(self, async_client: AsyncKnock) -> None: message = await async_client.messages.mark_as_interacted( @@ -988,7 +899,6 @@ async def test_method_mark_as_interacted_with_all_params(self, async_client: Asy ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_interacted(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.mark_as_interacted( @@ -1000,7 +910,6 @@ async def test_raw_response_mark_as_interacted(self, async_client: AsyncKnock) - message = await response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_interacted(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.mark_as_interacted( @@ -1014,7 +923,6 @@ async def test_streaming_response_mark_as_interacted(self, async_client: AsyncKn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_mark_as_interacted(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -1022,7 +930,6 @@ async def test_path_params_mark_as_interacted(self, async_client: AsyncKnock) -> message_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_read(self, async_client: AsyncKnock) -> None: message = await async_client.messages.mark_as_read( @@ -1030,7 +937,6 @@ async def test_method_mark_as_read(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_read(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.mark_as_read( @@ -1042,7 +948,6 @@ async def test_raw_response_mark_as_read(self, async_client: AsyncKnock) -> None message = await response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_read(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.mark_as_read( @@ -1056,7 +961,6 @@ async def test_streaming_response_mark_as_read(self, async_client: AsyncKnock) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_mark_as_read(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -1064,7 +968,6 @@ async def test_path_params_mark_as_read(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_seen(self, async_client: AsyncKnock) -> None: message = await async_client.messages.mark_as_seen( @@ -1072,7 +975,6 @@ async def test_method_mark_as_seen(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_seen(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.mark_as_seen( @@ -1084,7 +986,6 @@ async def test_raw_response_mark_as_seen(self, async_client: AsyncKnock) -> None message = await response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_seen(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.mark_as_seen( @@ -1098,7 +999,6 @@ async def test_streaming_response_mark_as_seen(self, async_client: AsyncKnock) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_mark_as_seen(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -1106,7 +1006,6 @@ async def test_path_params_mark_as_seen(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_unread(self, async_client: AsyncKnock) -> None: message = await async_client.messages.mark_as_unread( @@ -1114,7 +1013,6 @@ async def test_method_mark_as_unread(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_unread(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.mark_as_unread( @@ -1126,7 +1024,6 @@ async def test_raw_response_mark_as_unread(self, async_client: AsyncKnock) -> No message = await response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_unread(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.mark_as_unread( @@ -1140,7 +1037,6 @@ async def test_streaming_response_mark_as_unread(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_mark_as_unread(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -1148,7 +1044,6 @@ async def test_path_params_mark_as_unread(self, async_client: AsyncKnock) -> Non "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_as_unseen(self, async_client: AsyncKnock) -> None: message = await async_client.messages.mark_as_unseen( @@ -1156,7 +1051,6 @@ async def test_method_mark_as_unseen(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_as_unseen(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.mark_as_unseen( @@ -1168,7 +1062,6 @@ async def test_raw_response_mark_as_unseen(self, async_client: AsyncKnock) -> No message = await response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_as_unseen(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.mark_as_unseen( @@ -1182,7 +1075,6 @@ async def test_streaming_response_mark_as_unseen(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_mark_as_unseen(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): @@ -1190,7 +1082,6 @@ async def test_path_params_mark_as_unseen(self, async_client: AsyncKnock) -> Non "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_unarchive(self, async_client: AsyncKnock) -> None: message = await async_client.messages.unarchive( @@ -1198,7 +1089,6 @@ async def test_method_unarchive(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_unarchive(self, async_client: AsyncKnock) -> None: response = await async_client.messages.with_raw_response.unarchive( @@ -1210,7 +1100,6 @@ async def test_raw_response_unarchive(self, async_client: AsyncKnock) -> None: message = await response.parse() assert_matches_type(Message, message, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_unarchive(self, async_client: AsyncKnock) -> None: async with async_client.messages.with_streaming_response.unarchive( @@ -1224,7 +1113,6 @@ async def test_streaming_response_unarchive(self, async_client: AsyncKnock) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_unarchive(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `message_id` but received ''"): diff --git a/tests/api_resources/test_objects.py b/tests/api_resources/test_objects.py index b1187ab3..e1015b33 100644 --- a/tests/api_resources/test_objects.py +++ b/tests/api_resources/test_objects.py @@ -30,7 +30,6 @@ class TestObjects: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list(self, client: Knock) -> None: object_ = client.objects.list( @@ -38,7 +37,6 @@ def test_method_list(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Object], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_with_all_params(self, client: Knock) -> None: object_ = client.objects.list( @@ -50,7 +48,6 @@ def test_method_list_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Object], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list(self, client: Knock) -> None: response = client.objects.with_raw_response.list( @@ -62,7 +59,6 @@ def test_raw_response_list(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(SyncEntriesCursor[Object], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list(self, client: Knock) -> None: with client.objects.with_streaming_response.list( @@ -76,7 +72,6 @@ def test_streaming_response_list(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -84,7 +79,6 @@ def test_path_params_list(self, client: Knock) -> None: collection="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete(self, client: Knock) -> None: object_ = client.objects.delete( @@ -93,7 +87,6 @@ def test_method_delete(self, client: Knock) -> None: ) assert object_ is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete(self, client: Knock) -> None: response = client.objects.with_raw_response.delete( @@ -106,7 +99,6 @@ def test_raw_response_delete(self, client: Knock) -> None: object_ = response.parse() assert object_ is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete(self, client: Knock) -> None: with client.objects.with_streaming_response.delete( @@ -121,7 +113,6 @@ def test_streaming_response_delete(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_delete(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -136,7 +127,6 @@ def test_path_params_delete(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_add_subscriptions(self, client: Knock) -> None: object_ = client.objects.add_subscriptions( @@ -146,7 +136,6 @@ def test_method_add_subscriptions(self, client: Knock) -> None: ) assert_matches_type(ObjectAddSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_add_subscriptions_with_all_params(self, client: Knock) -> None: object_ = client.objects.add_subscriptions( @@ -157,7 +146,6 @@ def test_method_add_subscriptions_with_all_params(self, client: Knock) -> None: ) assert_matches_type(ObjectAddSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_add_subscriptions(self, client: Knock) -> None: response = client.objects.with_raw_response.add_subscriptions( @@ -171,7 +159,6 @@ def test_raw_response_add_subscriptions(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(ObjectAddSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_add_subscriptions(self, client: Knock) -> None: with client.objects.with_streaming_response.add_subscriptions( @@ -187,7 +174,6 @@ def test_streaming_response_add_subscriptions(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_add_subscriptions(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -204,7 +190,6 @@ def test_path_params_add_subscriptions(self, client: Knock) -> None: recipients=["user_1", "user_2"], ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete_subscriptions(self, client: Knock) -> None: object_ = client.objects.delete_subscriptions( @@ -214,7 +199,6 @@ def test_method_delete_subscriptions(self, client: Knock) -> None: ) assert_matches_type(ObjectDeleteSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete_subscriptions(self, client: Knock) -> None: response = client.objects.with_raw_response.delete_subscriptions( @@ -228,7 +212,6 @@ def test_raw_response_delete_subscriptions(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(ObjectDeleteSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete_subscriptions(self, client: Knock) -> None: with client.objects.with_streaming_response.delete_subscriptions( @@ -244,7 +227,6 @@ def test_streaming_response_delete_subscriptions(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_delete_subscriptions(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -261,7 +243,6 @@ def test_path_params_delete_subscriptions(self, client: Knock) -> None: recipients=["user_123"], ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get(self, client: Knock) -> None: object_ = client.objects.get( @@ -270,7 +251,6 @@ def test_method_get(self, client: Knock) -> None: ) assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get(self, client: Knock) -> None: response = client.objects.with_raw_response.get( @@ -283,7 +263,6 @@ def test_raw_response_get(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get(self, client: Knock) -> None: with client.objects.with_streaming_response.get( @@ -298,7 +277,6 @@ def test_streaming_response_get(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -313,7 +291,6 @@ def test_path_params_get(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_channel_data(self, client: Knock) -> None: object_ = client.objects.get_channel_data( @@ -323,7 +300,6 @@ def test_method_get_channel_data(self, client: Knock) -> None: ) assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get_channel_data(self, client: Knock) -> None: response = client.objects.with_raw_response.get_channel_data( @@ -337,7 +313,6 @@ def test_raw_response_get_channel_data(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get_channel_data(self, client: Knock) -> None: with client.objects.with_streaming_response.get_channel_data( @@ -353,7 +328,6 @@ def test_streaming_response_get_channel_data(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get_channel_data(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -377,7 +351,6 @@ def test_path_params_get_channel_data(self, client: Knock) -> None: channel_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_preferences(self, client: Knock) -> None: object_ = client.objects.get_preferences( @@ -387,7 +360,6 @@ def test_method_get_preferences(self, client: Knock) -> None: ) assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get_preferences(self, client: Knock) -> None: response = client.objects.with_raw_response.get_preferences( @@ -401,7 +373,6 @@ def test_raw_response_get_preferences(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get_preferences(self, client: Knock) -> None: with client.objects.with_streaming_response.get_preferences( @@ -417,7 +388,6 @@ def test_streaming_response_get_preferences(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get_preferences(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -441,7 +411,6 @@ def test_path_params_get_preferences(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_messages(self, client: Knock) -> None: object_ = client.objects.list_messages( @@ -450,7 +419,6 @@ def test_method_list_messages(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[Message], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_messages_with_all_params(self, client: Knock) -> None: object_ = client.objects.list_messages( @@ -478,7 +446,6 @@ def test_method_list_messages_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[Message], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_messages(self, client: Knock) -> None: response = client.objects.with_raw_response.list_messages( @@ -491,7 +458,6 @@ def test_raw_response_list_messages(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(SyncItemsCursor[Message], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_messages(self, client: Knock) -> None: with client.objects.with_streaming_response.list_messages( @@ -506,7 +472,6 @@ def test_streaming_response_list_messages(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_messages(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -521,7 +486,6 @@ def test_path_params_list_messages(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_preferences(self, client: Knock) -> None: object_ = client.objects.list_preferences( @@ -530,7 +494,6 @@ def test_method_list_preferences(self, client: Knock) -> None: ) assert_matches_type(ObjectListPreferencesResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_preferences(self, client: Knock) -> None: response = client.objects.with_raw_response.list_preferences( @@ -543,7 +506,6 @@ def test_raw_response_list_preferences(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(ObjectListPreferencesResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_preferences(self, client: Knock) -> None: with client.objects.with_streaming_response.list_preferences( @@ -558,7 +520,6 @@ def test_streaming_response_list_preferences(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_preferences(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -573,7 +534,6 @@ def test_path_params_list_preferences(self, client: Knock) -> None: object_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_schedules(self, client: Knock) -> None: object_ = client.objects.list_schedules( @@ -582,7 +542,6 @@ def test_method_list_schedules(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Schedule], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_schedules_with_all_params(self, client: Knock) -> None: object_ = client.objects.list_schedules( @@ -596,7 +555,6 @@ def test_method_list_schedules_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Schedule], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_schedules(self, client: Knock) -> None: response = client.objects.with_raw_response.list_schedules( @@ -609,7 +567,6 @@ def test_raw_response_list_schedules(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(SyncEntriesCursor[Schedule], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_schedules(self, client: Knock) -> None: with client.objects.with_streaming_response.list_schedules( @@ -624,7 +581,6 @@ def test_streaming_response_list_schedules(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_schedules(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -639,7 +595,6 @@ def test_path_params_list_schedules(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_subscriptions(self, client: Knock) -> None: object_ = client.objects.list_subscriptions( @@ -648,7 +603,6 @@ def test_method_list_subscriptions(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Subscription], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_subscriptions_with_all_params(self, client: Knock) -> None: object_ = client.objects.list_subscriptions( @@ -669,7 +623,6 @@ def test_method_list_subscriptions_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Subscription], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_subscriptions(self, client: Knock) -> None: response = client.objects.with_raw_response.list_subscriptions( @@ -682,7 +635,6 @@ def test_raw_response_list_subscriptions(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(SyncEntriesCursor[Subscription], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_subscriptions(self, client: Knock) -> None: with client.objects.with_streaming_response.list_subscriptions( @@ -697,7 +649,6 @@ def test_streaming_response_list_subscriptions(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_subscriptions(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -712,7 +663,6 @@ def test_path_params_list_subscriptions(self, client: Knock) -> None: object_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set(self, client: Knock) -> None: object_ = client.objects.set( @@ -721,7 +671,6 @@ def test_method_set(self, client: Knock) -> None: ) assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_with_all_params(self, client: Knock) -> None: object_ = client.objects.set( @@ -825,7 +774,6 @@ def test_method_set_with_all_params(self, client: Knock) -> None: ) assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set(self, client: Knock) -> None: response = client.objects.with_raw_response.set( @@ -838,7 +786,6 @@ def test_raw_response_set(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set(self, client: Knock) -> None: with client.objects.with_streaming_response.set( @@ -853,7 +800,6 @@ def test_streaming_response_set(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_set(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -868,7 +814,6 @@ def test_path_params_set(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_channel_data(self, client: Knock) -> None: object_ = client.objects.set_channel_data( @@ -879,7 +824,6 @@ def test_method_set_channel_data(self, client: Knock) -> None: ) assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_channel_data_with_all_params(self, client: Knock) -> None: object_ = client.objects.set_channel_data( @@ -890,7 +834,6 @@ def test_method_set_channel_data_with_all_params(self, client: Knock) -> None: ) assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set_channel_data(self, client: Knock) -> None: response = client.objects.with_raw_response.set_channel_data( @@ -905,7 +848,6 @@ def test_raw_response_set_channel_data(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set_channel_data(self, client: Knock) -> None: with client.objects.with_streaming_response.set_channel_data( @@ -922,7 +864,6 @@ def test_streaming_response_set_channel_data(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_set_channel_data(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -949,7 +890,6 @@ def test_path_params_set_channel_data(self, client: Knock) -> None: data={"tokens": ["push_token_1"]}, ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_preferences(self, client: Knock) -> None: object_ = client.objects.set_preferences( @@ -959,7 +899,6 @@ def test_method_set_preferences(self, client: Knock) -> None: ) assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_preferences_with_all_params(self, client: Knock) -> None: object_ = client.objects.set_preferences( @@ -1056,7 +995,6 @@ def test_method_set_preferences_with_all_params(self, client: Knock) -> None: ) assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set_preferences(self, client: Knock) -> None: response = client.objects.with_raw_response.set_preferences( @@ -1070,7 +1008,6 @@ def test_raw_response_set_preferences(self, client: Knock) -> None: object_ = response.parse() assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set_preferences(self, client: Knock) -> None: with client.objects.with_streaming_response.set_preferences( @@ -1086,7 +1023,6 @@ def test_streaming_response_set_preferences(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_set_preferences(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1110,7 +1046,6 @@ def test_path_params_set_preferences(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_unset_channel_data(self, client: Knock) -> None: object_ = client.objects.unset_channel_data( @@ -1120,7 +1055,6 @@ def test_method_unset_channel_data(self, client: Knock) -> None: ) assert object_ is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_unset_channel_data(self, client: Knock) -> None: response = client.objects.with_raw_response.unset_channel_data( @@ -1134,7 +1068,6 @@ def test_raw_response_unset_channel_data(self, client: Knock) -> None: object_ = response.parse() assert object_ is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_unset_channel_data(self, client: Knock) -> None: with client.objects.with_streaming_response.unset_channel_data( @@ -1150,7 +1083,6 @@ def test_streaming_response_unset_channel_data(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_unset_channel_data(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1180,7 +1112,6 @@ class TestAsyncObjects: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list( @@ -1188,7 +1119,6 @@ async def test_method_list(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncEntriesCursor[Object], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list( @@ -1200,7 +1130,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> No ) assert_matches_type(AsyncEntriesCursor[Object], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.list( @@ -1212,7 +1141,6 @@ async def test_raw_response_list(self, async_client: AsyncKnock) -> None: object_ = await response.parse() assert_matches_type(AsyncEntriesCursor[Object], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.list( @@ -1226,7 +1154,6 @@ async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1234,7 +1161,6 @@ async def test_path_params_list(self, async_client: AsyncKnock) -> None: collection="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.delete( @@ -1243,7 +1169,6 @@ async def test_method_delete(self, async_client: AsyncKnock) -> None: ) assert object_ is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.delete( @@ -1256,7 +1181,6 @@ async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: object_ = await response.parse() assert object_ is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.delete( @@ -1271,7 +1195,6 @@ async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_delete(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1286,7 +1209,6 @@ async def test_path_params_delete(self, async_client: AsyncKnock) -> None: id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_add_subscriptions(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.add_subscriptions( @@ -1296,7 +1218,6 @@ async def test_method_add_subscriptions(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ObjectAddSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_add_subscriptions_with_all_params(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.add_subscriptions( @@ -1307,7 +1228,6 @@ async def test_method_add_subscriptions_with_all_params(self, async_client: Asyn ) assert_matches_type(ObjectAddSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_add_subscriptions(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.add_subscriptions( @@ -1321,7 +1241,6 @@ async def test_raw_response_add_subscriptions(self, async_client: AsyncKnock) -> object_ = await response.parse() assert_matches_type(ObjectAddSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_add_subscriptions(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.add_subscriptions( @@ -1337,7 +1256,6 @@ async def test_streaming_response_add_subscriptions(self, async_client: AsyncKno assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_add_subscriptions(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1354,7 +1272,6 @@ async def test_path_params_add_subscriptions(self, async_client: AsyncKnock) -> recipients=["user_1", "user_2"], ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete_subscriptions(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.delete_subscriptions( @@ -1364,7 +1281,6 @@ async def test_method_delete_subscriptions(self, async_client: AsyncKnock) -> No ) assert_matches_type(ObjectDeleteSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete_subscriptions(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.delete_subscriptions( @@ -1378,7 +1294,6 @@ async def test_raw_response_delete_subscriptions(self, async_client: AsyncKnock) object_ = await response.parse() assert_matches_type(ObjectDeleteSubscriptionsResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete_subscriptions(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.delete_subscriptions( @@ -1394,7 +1309,6 @@ async def test_streaming_response_delete_subscriptions(self, async_client: Async assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_delete_subscriptions(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1411,7 +1325,6 @@ async def test_path_params_delete_subscriptions(self, async_client: AsyncKnock) recipients=["user_123"], ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.get( @@ -1420,7 +1333,6 @@ async def test_method_get(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.get( @@ -1433,7 +1345,6 @@ async def test_raw_response_get(self, async_client: AsyncKnock) -> None: object_ = await response.parse() assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.get( @@ -1448,7 +1359,6 @@ async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1463,7 +1373,6 @@ async def test_path_params_get(self, async_client: AsyncKnock) -> None: id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_channel_data(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.get_channel_data( @@ -1473,7 +1382,6 @@ async def test_method_get_channel_data(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get_channel_data(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.get_channel_data( @@ -1487,7 +1395,6 @@ async def test_raw_response_get_channel_data(self, async_client: AsyncKnock) -> object_ = await response.parse() assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get_channel_data(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.get_channel_data( @@ -1503,7 +1410,6 @@ async def test_streaming_response_get_channel_data(self, async_client: AsyncKnoc assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get_channel_data(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1527,7 +1433,6 @@ async def test_path_params_get_channel_data(self, async_client: AsyncKnock) -> N channel_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_preferences(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.get_preferences( @@ -1537,7 +1442,6 @@ async def test_method_get_preferences(self, async_client: AsyncKnock) -> None: ) assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get_preferences(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.get_preferences( @@ -1551,7 +1455,6 @@ async def test_raw_response_get_preferences(self, async_client: AsyncKnock) -> N object_ = await response.parse() assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get_preferences(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.get_preferences( @@ -1567,7 +1470,6 @@ async def test_streaming_response_get_preferences(self, async_client: AsyncKnock assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get_preferences(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1591,7 +1493,6 @@ async def test_path_params_get_preferences(self, async_client: AsyncKnock) -> No id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_messages(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list_messages( @@ -1600,7 +1501,6 @@ async def test_method_list_messages(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncItemsCursor[Message], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_messages_with_all_params(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list_messages( @@ -1628,7 +1528,6 @@ async def test_method_list_messages_with_all_params(self, async_client: AsyncKno ) assert_matches_type(AsyncItemsCursor[Message], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_messages(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.list_messages( @@ -1641,7 +1540,6 @@ async def test_raw_response_list_messages(self, async_client: AsyncKnock) -> Non object_ = await response.parse() assert_matches_type(AsyncItemsCursor[Message], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_messages(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.list_messages( @@ -1656,7 +1554,6 @@ async def test_streaming_response_list_messages(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_messages(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1671,7 +1568,6 @@ async def test_path_params_list_messages(self, async_client: AsyncKnock) -> None id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_preferences(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list_preferences( @@ -1680,7 +1576,6 @@ async def test_method_list_preferences(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ObjectListPreferencesResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_preferences(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.list_preferences( @@ -1693,7 +1588,6 @@ async def test_raw_response_list_preferences(self, async_client: AsyncKnock) -> object_ = await response.parse() assert_matches_type(ObjectListPreferencesResponse, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_preferences(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.list_preferences( @@ -1708,7 +1602,6 @@ async def test_streaming_response_list_preferences(self, async_client: AsyncKnoc assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_preferences(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1723,7 +1616,6 @@ async def test_path_params_list_preferences(self, async_client: AsyncKnock) -> N object_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_schedules(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list_schedules( @@ -1732,7 +1624,6 @@ async def test_method_list_schedules(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncEntriesCursor[Schedule], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_schedules_with_all_params(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list_schedules( @@ -1746,7 +1637,6 @@ async def test_method_list_schedules_with_all_params(self, async_client: AsyncKn ) assert_matches_type(AsyncEntriesCursor[Schedule], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_schedules(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.list_schedules( @@ -1759,7 +1649,6 @@ async def test_raw_response_list_schedules(self, async_client: AsyncKnock) -> No object_ = await response.parse() assert_matches_type(AsyncEntriesCursor[Schedule], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_schedules(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.list_schedules( @@ -1774,7 +1663,6 @@ async def test_streaming_response_list_schedules(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_schedules(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1789,7 +1677,6 @@ async def test_path_params_list_schedules(self, async_client: AsyncKnock) -> Non id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_subscriptions(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list_subscriptions( @@ -1798,7 +1685,6 @@ async def test_method_list_subscriptions(self, async_client: AsyncKnock) -> None ) assert_matches_type(AsyncEntriesCursor[Subscription], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_subscriptions_with_all_params(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.list_subscriptions( @@ -1819,7 +1705,6 @@ async def test_method_list_subscriptions_with_all_params(self, async_client: Asy ) assert_matches_type(AsyncEntriesCursor[Subscription], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_subscriptions(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.list_subscriptions( @@ -1832,7 +1717,6 @@ async def test_raw_response_list_subscriptions(self, async_client: AsyncKnock) - object_ = await response.parse() assert_matches_type(AsyncEntriesCursor[Subscription], object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_subscriptions(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.list_subscriptions( @@ -1847,7 +1731,6 @@ async def test_streaming_response_list_subscriptions(self, async_client: AsyncKn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_subscriptions(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -1862,7 +1745,6 @@ async def test_path_params_list_subscriptions(self, async_client: AsyncKnock) -> object_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.set( @@ -1871,7 +1753,6 @@ async def test_method_set(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_with_all_params(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.set( @@ -1975,7 +1856,6 @@ async def test_method_set_with_all_params(self, async_client: AsyncKnock) -> Non ) assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.set( @@ -1988,7 +1868,6 @@ async def test_raw_response_set(self, async_client: AsyncKnock) -> None: object_ = await response.parse() assert_matches_type(Object, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.set( @@ -2003,7 +1882,6 @@ async def test_streaming_response_set(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_set(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -2018,7 +1896,6 @@ async def test_path_params_set(self, async_client: AsyncKnock) -> None: id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_channel_data(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.set_channel_data( @@ -2029,7 +1906,6 @@ async def test_method_set_channel_data(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_channel_data_with_all_params(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.set_channel_data( @@ -2040,7 +1916,6 @@ async def test_method_set_channel_data_with_all_params(self, async_client: Async ) assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set_channel_data(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.set_channel_data( @@ -2055,7 +1930,6 @@ async def test_raw_response_set_channel_data(self, async_client: AsyncKnock) -> object_ = await response.parse() assert_matches_type(ChannelData, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set_channel_data(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.set_channel_data( @@ -2072,7 +1946,6 @@ async def test_streaming_response_set_channel_data(self, async_client: AsyncKnoc assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_set_channel_data(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -2099,7 +1972,6 @@ async def test_path_params_set_channel_data(self, async_client: AsyncKnock) -> N data={"tokens": ["push_token_1"]}, ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_preferences(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.set_preferences( @@ -2109,7 +1981,6 @@ async def test_method_set_preferences(self, async_client: AsyncKnock) -> None: ) assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_preferences_with_all_params(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.set_preferences( @@ -2206,7 +2077,6 @@ async def test_method_set_preferences_with_all_params(self, async_client: AsyncK ) assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set_preferences(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.set_preferences( @@ -2220,7 +2090,6 @@ async def test_raw_response_set_preferences(self, async_client: AsyncKnock) -> N object_ = await response.parse() assert_matches_type(PreferenceSet, object_, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set_preferences(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.set_preferences( @@ -2236,7 +2105,6 @@ async def test_streaming_response_set_preferences(self, async_client: AsyncKnock assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_set_preferences(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): @@ -2260,7 +2128,6 @@ async def test_path_params_set_preferences(self, async_client: AsyncKnock) -> No id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_unset_channel_data(self, async_client: AsyncKnock) -> None: object_ = await async_client.objects.unset_channel_data( @@ -2270,7 +2137,6 @@ async def test_method_unset_channel_data(self, async_client: AsyncKnock) -> None ) assert object_ is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_unset_channel_data(self, async_client: AsyncKnock) -> None: response = await async_client.objects.with_raw_response.unset_channel_data( @@ -2284,7 +2150,6 @@ async def test_raw_response_unset_channel_data(self, async_client: AsyncKnock) - object_ = await response.parse() assert object_ is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_unset_channel_data(self, async_client: AsyncKnock) -> None: async with async_client.objects.with_streaming_response.unset_channel_data( @@ -2300,7 +2165,6 @@ async def test_streaming_response_unset_channel_data(self, async_client: AsyncKn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_unset_channel_data(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `collection` but received ''"): diff --git a/tests/api_resources/test_schedules.py b/tests/api_resources/test_schedules.py index 743d9f74..ebed132f 100644 --- a/tests/api_resources/test_schedules.py +++ b/tests/api_resources/test_schedules.py @@ -24,7 +24,6 @@ class TestSchedules: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_create(self, client: Knock) -> None: schedule = client.schedules.create( @@ -33,7 +32,6 @@ def test_method_create(self, client: Knock) -> None: ) assert_matches_type(ScheduleCreateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_create_with_all_params(self, client: Knock) -> None: schedule = client.schedules.create( @@ -159,7 +157,6 @@ def test_method_create_with_all_params(self, client: Knock) -> None: ) assert_matches_type(ScheduleCreateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_create(self, client: Knock) -> None: response = client.schedules.with_raw_response.create( @@ -172,7 +169,6 @@ def test_raw_response_create(self, client: Knock) -> None: schedule = response.parse() assert_matches_type(ScheduleCreateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_create(self, client: Knock) -> None: with client.schedules.with_streaming_response.create( @@ -187,7 +183,6 @@ def test_streaming_response_create(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_update(self, client: Knock) -> None: schedule = client.schedules.update( @@ -195,7 +190,6 @@ def test_method_update(self, client: Knock) -> None: ) assert_matches_type(ScheduleUpdateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_update_with_all_params(self, client: Knock) -> None: schedule = client.schedules.update( @@ -219,7 +213,6 @@ def test_method_update_with_all_params(self, client: Knock) -> None: ) assert_matches_type(ScheduleUpdateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_update(self, client: Knock) -> None: response = client.schedules.with_raw_response.update( @@ -231,7 +224,6 @@ def test_raw_response_update(self, client: Knock) -> None: schedule = response.parse() assert_matches_type(ScheduleUpdateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_update(self, client: Knock) -> None: with client.schedules.with_streaming_response.update( @@ -245,7 +237,6 @@ def test_streaming_response_update(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list(self, client: Knock) -> None: schedule = client.schedules.list( @@ -253,7 +244,6 @@ def test_method_list(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Schedule], schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_with_all_params(self, client: Knock) -> None: schedule = client.schedules.list( @@ -266,7 +256,6 @@ def test_method_list_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Schedule], schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list(self, client: Knock) -> None: response = client.schedules.with_raw_response.list( @@ -278,7 +267,6 @@ def test_raw_response_list(self, client: Knock) -> None: schedule = response.parse() assert_matches_type(SyncEntriesCursor[Schedule], schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list(self, client: Knock) -> None: with client.schedules.with_streaming_response.list( @@ -292,7 +280,6 @@ def test_streaming_response_list(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete(self, client: Knock) -> None: schedule = client.schedules.delete( @@ -300,7 +287,6 @@ def test_method_delete(self, client: Knock) -> None: ) assert_matches_type(ScheduleDeleteResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete(self, client: Knock) -> None: response = client.schedules.with_raw_response.delete( @@ -312,7 +298,6 @@ def test_raw_response_delete(self, client: Knock) -> None: schedule = response.parse() assert_matches_type(ScheduleDeleteResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete(self, client: Knock) -> None: with client.schedules.with_streaming_response.delete( @@ -332,7 +317,6 @@ class TestAsyncSchedules: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_create(self, async_client: AsyncKnock) -> None: schedule = await async_client.schedules.create( @@ -341,7 +325,6 @@ async def test_method_create(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ScheduleCreateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncKnock) -> None: schedule = await async_client.schedules.create( @@ -467,7 +450,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncKnock) -> ) assert_matches_type(ScheduleCreateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_create(self, async_client: AsyncKnock) -> None: response = await async_client.schedules.with_raw_response.create( @@ -480,7 +462,6 @@ async def test_raw_response_create(self, async_client: AsyncKnock) -> None: schedule = await response.parse() assert_matches_type(ScheduleCreateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_create(self, async_client: AsyncKnock) -> None: async with async_client.schedules.with_streaming_response.create( @@ -495,7 +476,6 @@ async def test_streaming_response_create(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_update(self, async_client: AsyncKnock) -> None: schedule = await async_client.schedules.update( @@ -503,7 +483,6 @@ async def test_method_update(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ScheduleUpdateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncKnock) -> None: schedule = await async_client.schedules.update( @@ -527,7 +506,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncKnock) -> ) assert_matches_type(ScheduleUpdateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_update(self, async_client: AsyncKnock) -> None: response = await async_client.schedules.with_raw_response.update( @@ -539,7 +517,6 @@ async def test_raw_response_update(self, async_client: AsyncKnock) -> None: schedule = await response.parse() assert_matches_type(ScheduleUpdateResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_update(self, async_client: AsyncKnock) -> None: async with async_client.schedules.with_streaming_response.update( @@ -553,7 +530,6 @@ async def test_streaming_response_update(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list(self, async_client: AsyncKnock) -> None: schedule = await async_client.schedules.list( @@ -561,7 +537,6 @@ async def test_method_list(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncEntriesCursor[Schedule], schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> None: schedule = await async_client.schedules.list( @@ -574,7 +549,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> No ) assert_matches_type(AsyncEntriesCursor[Schedule], schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list(self, async_client: AsyncKnock) -> None: response = await async_client.schedules.with_raw_response.list( @@ -586,7 +560,6 @@ async def test_raw_response_list(self, async_client: AsyncKnock) -> None: schedule = await response.parse() assert_matches_type(AsyncEntriesCursor[Schedule], schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: async with async_client.schedules.with_streaming_response.list( @@ -600,7 +573,6 @@ async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete(self, async_client: AsyncKnock) -> None: schedule = await async_client.schedules.delete( @@ -608,7 +580,6 @@ async def test_method_delete(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ScheduleDeleteResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: response = await async_client.schedules.with_raw_response.delete( @@ -620,7 +591,6 @@ async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: schedule = await response.parse() assert_matches_type(ScheduleDeleteResponse, schedule, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None: async with async_client.schedules.with_streaming_response.delete( diff --git a/tests/api_resources/test_tenants.py b/tests/api_resources/test_tenants.py index 796aa18a..4fc5b9d3 100644 --- a/tests/api_resources/test_tenants.py +++ b/tests/api_resources/test_tenants.py @@ -18,13 +18,11 @@ class TestTenants: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list(self, client: Knock) -> None: tenant = client.tenants.list() assert_matches_type(SyncEntriesCursor[Tenant], tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_with_all_params(self, client: Knock) -> None: tenant = client.tenants.list( @@ -36,7 +34,6 @@ def test_method_list_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Tenant], tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list(self, client: Knock) -> None: response = client.tenants.with_raw_response.list() @@ -46,7 +43,6 @@ def test_raw_response_list(self, client: Knock) -> None: tenant = response.parse() assert_matches_type(SyncEntriesCursor[Tenant], tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list(self, client: Knock) -> None: with client.tenants.with_streaming_response.list() as response: @@ -58,7 +54,6 @@ def test_streaming_response_list(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete(self, client: Knock) -> None: tenant = client.tenants.delete( @@ -66,7 +61,6 @@ def test_method_delete(self, client: Knock) -> None: ) assert tenant is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete(self, client: Knock) -> None: response = client.tenants.with_raw_response.delete( @@ -78,7 +72,6 @@ def test_raw_response_delete(self, client: Knock) -> None: tenant = response.parse() assert tenant is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete(self, client: Knock) -> None: with client.tenants.with_streaming_response.delete( @@ -92,7 +85,6 @@ def test_streaming_response_delete(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_delete(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): @@ -100,7 +92,6 @@ def test_path_params_delete(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get(self, client: Knock) -> None: tenant = client.tenants.get( @@ -108,7 +99,6 @@ def test_method_get(self, client: Knock) -> None: ) assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_with_all_params(self, client: Knock) -> None: tenant = client.tenants.get( @@ -117,7 +107,6 @@ def test_method_get_with_all_params(self, client: Knock) -> None: ) assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get(self, client: Knock) -> None: response = client.tenants.with_raw_response.get( @@ -129,7 +118,6 @@ def test_raw_response_get(self, client: Knock) -> None: tenant = response.parse() assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get(self, client: Knock) -> None: with client.tenants.with_streaming_response.get( @@ -143,7 +131,6 @@ def test_streaming_response_get(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): @@ -151,7 +138,6 @@ def test_path_params_get(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set(self, client: Knock) -> None: tenant = client.tenants.set( @@ -159,7 +145,6 @@ def test_method_set(self, client: Knock) -> None: ) assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_with_all_params(self, client: Knock) -> None: tenant = client.tenants.set( @@ -267,7 +252,6 @@ def test_method_set_with_all_params(self, client: Knock) -> None: ) assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set(self, client: Knock) -> None: response = client.tenants.with_raw_response.set( @@ -279,7 +263,6 @@ def test_raw_response_set(self, client: Knock) -> None: tenant = response.parse() assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set(self, client: Knock) -> None: with client.tenants.with_streaming_response.set( @@ -293,7 +276,6 @@ def test_streaming_response_set(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_set(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): @@ -307,13 +289,11 @@ class TestAsyncTenants: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list(self, async_client: AsyncKnock) -> None: tenant = await async_client.tenants.list() assert_matches_type(AsyncEntriesCursor[Tenant], tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> None: tenant = await async_client.tenants.list( @@ -325,7 +305,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> No ) assert_matches_type(AsyncEntriesCursor[Tenant], tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list(self, async_client: AsyncKnock) -> None: response = await async_client.tenants.with_raw_response.list() @@ -335,7 +314,6 @@ async def test_raw_response_list(self, async_client: AsyncKnock) -> None: tenant = await response.parse() assert_matches_type(AsyncEntriesCursor[Tenant], tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: async with async_client.tenants.with_streaming_response.list() as response: @@ -347,7 +325,6 @@ async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete(self, async_client: AsyncKnock) -> None: tenant = await async_client.tenants.delete( @@ -355,7 +332,6 @@ async def test_method_delete(self, async_client: AsyncKnock) -> None: ) assert tenant is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: response = await async_client.tenants.with_raw_response.delete( @@ -367,7 +343,6 @@ async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: tenant = await response.parse() assert tenant is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None: async with async_client.tenants.with_streaming_response.delete( @@ -381,7 +356,6 @@ async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_delete(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): @@ -389,7 +363,6 @@ async def test_path_params_delete(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get(self, async_client: AsyncKnock) -> None: tenant = await async_client.tenants.get( @@ -397,7 +370,6 @@ async def test_method_get(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_with_all_params(self, async_client: AsyncKnock) -> None: tenant = await async_client.tenants.get( @@ -406,7 +378,6 @@ async def test_method_get_with_all_params(self, async_client: AsyncKnock) -> Non ) assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get(self, async_client: AsyncKnock) -> None: response = await async_client.tenants.with_raw_response.get( @@ -418,7 +389,6 @@ async def test_raw_response_get(self, async_client: AsyncKnock) -> None: tenant = await response.parse() assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: async with async_client.tenants.with_streaming_response.get( @@ -432,7 +402,6 @@ async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): @@ -440,7 +409,6 @@ async def test_path_params_get(self, async_client: AsyncKnock) -> None: id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set(self, async_client: AsyncKnock) -> None: tenant = await async_client.tenants.set( @@ -448,7 +416,6 @@ async def test_method_set(self, async_client: AsyncKnock) -> None: ) assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_with_all_params(self, async_client: AsyncKnock) -> None: tenant = await async_client.tenants.set( @@ -556,7 +523,6 @@ async def test_method_set_with_all_params(self, async_client: AsyncKnock) -> Non ) assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set(self, async_client: AsyncKnock) -> None: response = await async_client.tenants.with_raw_response.set( @@ -568,7 +534,6 @@ async def test_raw_response_set(self, async_client: AsyncKnock) -> None: tenant = await response.parse() assert_matches_type(Tenant, tenant, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set(self, async_client: AsyncKnock) -> None: async with async_client.tenants.with_streaming_response.set( @@ -582,7 +547,6 @@ async def test_streaming_response_set(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_set(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): diff --git a/tests/api_resources/test_users.py b/tests/api_resources/test_users.py index 6992c081..1b172c1f 100644 --- a/tests/api_resources/test_users.py +++ b/tests/api_resources/test_users.py @@ -29,7 +29,6 @@ class TestUsers: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_update(self, client: Knock) -> None: user = client.users.update( @@ -37,7 +36,6 @@ def test_method_update(self, client: Knock) -> None: ) assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_update_with_all_params(self, client: Knock) -> None: user = client.users.update( @@ -144,7 +142,6 @@ def test_method_update_with_all_params(self, client: Knock) -> None: ) assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_update(self, client: Knock) -> None: response = client.users.with_raw_response.update( @@ -156,7 +153,6 @@ def test_raw_response_update(self, client: Knock) -> None: user = response.parse() assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_update(self, client: Knock) -> None: with client.users.with_streaming_response.update( @@ -170,7 +166,6 @@ def test_streaming_response_update(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_update(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -178,13 +173,11 @@ def test_path_params_update(self, client: Knock) -> None: user_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list(self, client: Knock) -> None: user = client.users.list() assert_matches_type(SyncEntriesCursor[User], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_with_all_params(self, client: Knock) -> None: user = client.users.list( @@ -195,7 +188,6 @@ def test_method_list_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[User], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list(self, client: Knock) -> None: response = client.users.with_raw_response.list() @@ -205,7 +197,6 @@ def test_raw_response_list(self, client: Knock) -> None: user = response.parse() assert_matches_type(SyncEntriesCursor[User], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list(self, client: Knock) -> None: with client.users.with_streaming_response.list() as response: @@ -217,7 +208,6 @@ def test_streaming_response_list(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete(self, client: Knock) -> None: user = client.users.delete( @@ -225,7 +215,6 @@ def test_method_delete(self, client: Knock) -> None: ) assert user is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete(self, client: Knock) -> None: response = client.users.with_raw_response.delete( @@ -237,7 +226,6 @@ def test_raw_response_delete(self, client: Knock) -> None: user = response.parse() assert user is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete(self, client: Knock) -> None: with client.users.with_streaming_response.delete( @@ -251,7 +239,6 @@ def test_streaming_response_delete(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_delete(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -259,7 +246,6 @@ def test_path_params_delete(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get(self, client: Knock) -> None: user = client.users.get( @@ -267,7 +253,6 @@ def test_method_get(self, client: Knock) -> None: ) assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get(self, client: Knock) -> None: response = client.users.with_raw_response.get( @@ -279,7 +264,6 @@ def test_raw_response_get(self, client: Knock) -> None: user = response.parse() assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get(self, client: Knock) -> None: with client.users.with_streaming_response.get( @@ -293,7 +277,6 @@ def test_streaming_response_get(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -301,7 +284,6 @@ def test_path_params_get(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_channel_data(self, client: Knock) -> None: user = client.users.get_channel_data( @@ -310,7 +292,6 @@ def test_method_get_channel_data(self, client: Knock) -> None: ) assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get_channel_data(self, client: Knock) -> None: response = client.users.with_raw_response.get_channel_data( @@ -323,7 +304,6 @@ def test_raw_response_get_channel_data(self, client: Knock) -> None: user = response.parse() assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get_channel_data(self, client: Knock) -> None: with client.users.with_streaming_response.get_channel_data( @@ -338,7 +318,6 @@ def test_streaming_response_get_channel_data(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get_channel_data(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -353,7 +332,6 @@ def test_path_params_get_channel_data(self, client: Knock) -> None: channel_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_preferences(self, client: Knock) -> None: user = client.users.get_preferences( @@ -362,7 +340,6 @@ def test_method_get_preferences(self, client: Knock) -> None: ) assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_preferences_with_all_params(self, client: Knock) -> None: user = client.users.get_preferences( @@ -372,7 +349,6 @@ def test_method_get_preferences_with_all_params(self, client: Knock) -> None: ) assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get_preferences(self, client: Knock) -> None: response = client.users.with_raw_response.get_preferences( @@ -385,7 +361,6 @@ def test_raw_response_get_preferences(self, client: Knock) -> None: user = response.parse() assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get_preferences(self, client: Knock) -> None: with client.users.with_streaming_response.get_preferences( @@ -400,7 +375,6 @@ def test_streaming_response_get_preferences(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get_preferences(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -415,7 +389,6 @@ def test_path_params_get_preferences(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_messages(self, client: Knock) -> None: user = client.users.list_messages( @@ -423,7 +396,6 @@ def test_method_list_messages(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[Message], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_messages_with_all_params(self, client: Knock) -> None: user = client.users.list_messages( @@ -450,7 +422,6 @@ def test_method_list_messages_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncItemsCursor[Message], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_messages(self, client: Knock) -> None: response = client.users.with_raw_response.list_messages( @@ -462,7 +433,6 @@ def test_raw_response_list_messages(self, client: Knock) -> None: user = response.parse() assert_matches_type(SyncItemsCursor[Message], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_messages(self, client: Knock) -> None: with client.users.with_streaming_response.list_messages( @@ -476,7 +446,6 @@ def test_streaming_response_list_messages(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_messages(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -484,7 +453,6 @@ def test_path_params_list_messages(self, client: Knock) -> None: user_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_preferences(self, client: Knock) -> None: user = client.users.list_preferences( @@ -492,7 +460,6 @@ def test_method_list_preferences(self, client: Knock) -> None: ) assert_matches_type(UserListPreferencesResponse, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_preferences(self, client: Knock) -> None: response = client.users.with_raw_response.list_preferences( @@ -504,7 +471,6 @@ def test_raw_response_list_preferences(self, client: Knock) -> None: user = response.parse() assert_matches_type(UserListPreferencesResponse, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_preferences(self, client: Knock) -> None: with client.users.with_streaming_response.list_preferences( @@ -518,7 +484,6 @@ def test_streaming_response_list_preferences(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_preferences(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -526,7 +491,6 @@ def test_path_params_list_preferences(self, client: Knock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_schedules(self, client: Knock) -> None: user = client.users.list_schedules( @@ -534,7 +498,6 @@ def test_method_list_schedules(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Schedule], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_schedules_with_all_params(self, client: Knock) -> None: user = client.users.list_schedules( @@ -547,7 +510,6 @@ def test_method_list_schedules_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Schedule], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_schedules(self, client: Knock) -> None: response = client.users.with_raw_response.list_schedules( @@ -559,7 +521,6 @@ def test_raw_response_list_schedules(self, client: Knock) -> None: user = response.parse() assert_matches_type(SyncEntriesCursor[Schedule], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_schedules(self, client: Knock) -> None: with client.users.with_streaming_response.list_schedules( @@ -573,7 +534,6 @@ def test_streaming_response_list_schedules(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_schedules(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -581,7 +541,6 @@ def test_path_params_list_schedules(self, client: Knock) -> None: user_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_subscriptions(self, client: Knock) -> None: user = client.users.list_subscriptions( @@ -589,7 +548,6 @@ def test_method_list_subscriptions(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Subscription], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_subscriptions_with_all_params(self, client: Knock) -> None: user = client.users.list_subscriptions( @@ -602,7 +560,6 @@ def test_method_list_subscriptions_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[Subscription], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_subscriptions(self, client: Knock) -> None: response = client.users.with_raw_response.list_subscriptions( @@ -614,7 +571,6 @@ def test_raw_response_list_subscriptions(self, client: Knock) -> None: user = response.parse() assert_matches_type(SyncEntriesCursor[Subscription], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_subscriptions(self, client: Knock) -> None: with client.users.with_streaming_response.list_subscriptions( @@ -628,7 +584,6 @@ def test_streaming_response_list_subscriptions(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_subscriptions(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -636,7 +591,6 @@ def test_path_params_list_subscriptions(self, client: Knock) -> None: user_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_merge(self, client: Knock) -> None: user = client.users.merge( @@ -645,7 +599,6 @@ def test_method_merge(self, client: Knock) -> None: ) assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_merge(self, client: Knock) -> None: response = client.users.with_raw_response.merge( @@ -658,7 +611,6 @@ def test_raw_response_merge(self, client: Knock) -> None: user = response.parse() assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_merge(self, client: Knock) -> None: with client.users.with_streaming_response.merge( @@ -673,7 +625,6 @@ def test_streaming_response_merge(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_merge(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -682,7 +633,6 @@ def test_path_params_merge(self, client: Knock) -> None: from_user_id="user_1", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_channel_data(self, client: Knock) -> None: user = client.users.set_channel_data( @@ -692,7 +642,6 @@ def test_method_set_channel_data(self, client: Knock) -> None: ) assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_channel_data_with_all_params(self, client: Knock) -> None: user = client.users.set_channel_data( @@ -702,7 +651,6 @@ def test_method_set_channel_data_with_all_params(self, client: Knock) -> None: ) assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set_channel_data(self, client: Knock) -> None: response = client.users.with_raw_response.set_channel_data( @@ -716,7 +664,6 @@ def test_raw_response_set_channel_data(self, client: Knock) -> None: user = response.parse() assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set_channel_data(self, client: Knock) -> None: with client.users.with_streaming_response.set_channel_data( @@ -732,7 +679,6 @@ def test_streaming_response_set_channel_data(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_set_channel_data(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -749,7 +695,6 @@ def test_path_params_set_channel_data(self, client: Knock) -> None: data={"tokens": ["push_token_1"]}, ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_preferences(self, client: Knock) -> None: user = client.users.set_preferences( @@ -758,7 +703,6 @@ def test_method_set_preferences(self, client: Knock) -> None: ) assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_preferences_with_all_params(self, client: Knock) -> None: user = client.users.set_preferences( @@ -854,7 +798,6 @@ def test_method_set_preferences_with_all_params(self, client: Knock) -> None: ) assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set_preferences(self, client: Knock) -> None: response = client.users.with_raw_response.set_preferences( @@ -867,7 +810,6 @@ def test_raw_response_set_preferences(self, client: Knock) -> None: user = response.parse() assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set_preferences(self, client: Knock) -> None: with client.users.with_streaming_response.set_preferences( @@ -882,7 +824,6 @@ def test_streaming_response_set_preferences(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_set_preferences(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -897,7 +838,6 @@ def test_path_params_set_preferences(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_unset_channel_data(self, client: Knock) -> None: user = client.users.unset_channel_data( @@ -906,7 +846,6 @@ def test_method_unset_channel_data(self, client: Knock) -> None: ) assert user is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_unset_channel_data(self, client: Knock) -> None: response = client.users.with_raw_response.unset_channel_data( @@ -919,7 +858,6 @@ def test_raw_response_unset_channel_data(self, client: Knock) -> None: user = response.parse() assert user is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_unset_channel_data(self, client: Knock) -> None: with client.users.with_streaming_response.unset_channel_data( @@ -934,7 +872,6 @@ def test_streaming_response_unset_channel_data(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_unset_channel_data(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -955,7 +892,6 @@ class TestAsyncUsers: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_update(self, async_client: AsyncKnock) -> None: user = await async_client.users.update( @@ -963,7 +899,6 @@ async def test_method_update(self, async_client: AsyncKnock) -> None: ) assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncKnock) -> None: user = await async_client.users.update( @@ -1070,7 +1005,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncKnock) -> ) assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_update(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.update( @@ -1082,7 +1016,6 @@ async def test_raw_response_update(self, async_client: AsyncKnock) -> None: user = await response.parse() assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_update(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.update( @@ -1096,7 +1029,6 @@ async def test_streaming_response_update(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_update(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1104,13 +1036,11 @@ async def test_path_params_update(self, async_client: AsyncKnock) -> None: user_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list(self, async_client: AsyncKnock) -> None: user = await async_client.users.list() assert_matches_type(AsyncEntriesCursor[User], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> None: user = await async_client.users.list( @@ -1121,7 +1051,6 @@ async def test_method_list_with_all_params(self, async_client: AsyncKnock) -> No ) assert_matches_type(AsyncEntriesCursor[User], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.list() @@ -1131,7 +1060,6 @@ async def test_raw_response_list(self, async_client: AsyncKnock) -> None: user = await response.parse() assert_matches_type(AsyncEntriesCursor[User], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.list() as response: @@ -1143,7 +1071,6 @@ async def test_streaming_response_list(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete(self, async_client: AsyncKnock) -> None: user = await async_client.users.delete( @@ -1151,7 +1078,6 @@ async def test_method_delete(self, async_client: AsyncKnock) -> None: ) assert user is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.delete( @@ -1163,7 +1089,6 @@ async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: user = await response.parse() assert user is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.delete( @@ -1177,7 +1102,6 @@ async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_delete(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1185,7 +1109,6 @@ async def test_path_params_delete(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get(self, async_client: AsyncKnock) -> None: user = await async_client.users.get( @@ -1193,7 +1116,6 @@ async def test_method_get(self, async_client: AsyncKnock) -> None: ) assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.get( @@ -1205,7 +1127,6 @@ async def test_raw_response_get(self, async_client: AsyncKnock) -> None: user = await response.parse() assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.get( @@ -1219,7 +1140,6 @@ async def test_streaming_response_get(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1227,7 +1147,6 @@ async def test_path_params_get(self, async_client: AsyncKnock) -> None: "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_channel_data(self, async_client: AsyncKnock) -> None: user = await async_client.users.get_channel_data( @@ -1236,7 +1155,6 @@ async def test_method_get_channel_data(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get_channel_data(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.get_channel_data( @@ -1249,7 +1167,6 @@ async def test_raw_response_get_channel_data(self, async_client: AsyncKnock) -> user = await response.parse() assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get_channel_data(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.get_channel_data( @@ -1264,7 +1181,6 @@ async def test_streaming_response_get_channel_data(self, async_client: AsyncKnoc assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get_channel_data(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1279,7 +1195,6 @@ async def test_path_params_get_channel_data(self, async_client: AsyncKnock) -> N channel_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_preferences(self, async_client: AsyncKnock) -> None: user = await async_client.users.get_preferences( @@ -1288,7 +1203,6 @@ async def test_method_get_preferences(self, async_client: AsyncKnock) -> None: ) assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_preferences_with_all_params(self, async_client: AsyncKnock) -> None: user = await async_client.users.get_preferences( @@ -1298,7 +1212,6 @@ async def test_method_get_preferences_with_all_params(self, async_client: AsyncK ) assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get_preferences(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.get_preferences( @@ -1311,7 +1224,6 @@ async def test_raw_response_get_preferences(self, async_client: AsyncKnock) -> N user = await response.parse() assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get_preferences(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.get_preferences( @@ -1326,7 +1238,6 @@ async def test_streaming_response_get_preferences(self, async_client: AsyncKnock assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get_preferences(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1341,7 +1252,6 @@ async def test_path_params_get_preferences(self, async_client: AsyncKnock) -> No id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_messages(self, async_client: AsyncKnock) -> None: user = await async_client.users.list_messages( @@ -1349,7 +1259,6 @@ async def test_method_list_messages(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncItemsCursor[Message], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_messages_with_all_params(self, async_client: AsyncKnock) -> None: user = await async_client.users.list_messages( @@ -1376,7 +1285,6 @@ async def test_method_list_messages_with_all_params(self, async_client: AsyncKno ) assert_matches_type(AsyncItemsCursor[Message], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_messages(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.list_messages( @@ -1388,7 +1296,6 @@ async def test_raw_response_list_messages(self, async_client: AsyncKnock) -> Non user = await response.parse() assert_matches_type(AsyncItemsCursor[Message], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_messages(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.list_messages( @@ -1402,7 +1309,6 @@ async def test_streaming_response_list_messages(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_messages(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1410,7 +1316,6 @@ async def test_path_params_list_messages(self, async_client: AsyncKnock) -> None user_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_preferences(self, async_client: AsyncKnock) -> None: user = await async_client.users.list_preferences( @@ -1418,7 +1323,6 @@ async def test_method_list_preferences(self, async_client: AsyncKnock) -> None: ) assert_matches_type(UserListPreferencesResponse, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_preferences(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.list_preferences( @@ -1430,7 +1334,6 @@ async def test_raw_response_list_preferences(self, async_client: AsyncKnock) -> user = await response.parse() assert_matches_type(UserListPreferencesResponse, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_preferences(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.list_preferences( @@ -1444,7 +1347,6 @@ async def test_streaming_response_list_preferences(self, async_client: AsyncKnoc assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_preferences(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1452,7 +1354,6 @@ async def test_path_params_list_preferences(self, async_client: AsyncKnock) -> N "", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_schedules(self, async_client: AsyncKnock) -> None: user = await async_client.users.list_schedules( @@ -1460,7 +1361,6 @@ async def test_method_list_schedules(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncEntriesCursor[Schedule], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_schedules_with_all_params(self, async_client: AsyncKnock) -> None: user = await async_client.users.list_schedules( @@ -1473,7 +1373,6 @@ async def test_method_list_schedules_with_all_params(self, async_client: AsyncKn ) assert_matches_type(AsyncEntriesCursor[Schedule], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_schedules(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.list_schedules( @@ -1485,7 +1384,6 @@ async def test_raw_response_list_schedules(self, async_client: AsyncKnock) -> No user = await response.parse() assert_matches_type(AsyncEntriesCursor[Schedule], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_schedules(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.list_schedules( @@ -1499,7 +1397,6 @@ async def test_streaming_response_list_schedules(self, async_client: AsyncKnock) assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_schedules(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1507,7 +1404,6 @@ async def test_path_params_list_schedules(self, async_client: AsyncKnock) -> Non user_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_subscriptions(self, async_client: AsyncKnock) -> None: user = await async_client.users.list_subscriptions( @@ -1515,7 +1411,6 @@ async def test_method_list_subscriptions(self, async_client: AsyncKnock) -> None ) assert_matches_type(AsyncEntriesCursor[Subscription], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_subscriptions_with_all_params(self, async_client: AsyncKnock) -> None: user = await async_client.users.list_subscriptions( @@ -1528,7 +1423,6 @@ async def test_method_list_subscriptions_with_all_params(self, async_client: Asy ) assert_matches_type(AsyncEntriesCursor[Subscription], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_subscriptions(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.list_subscriptions( @@ -1540,7 +1434,6 @@ async def test_raw_response_list_subscriptions(self, async_client: AsyncKnock) - user = await response.parse() assert_matches_type(AsyncEntriesCursor[Subscription], user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_subscriptions(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.list_subscriptions( @@ -1554,7 +1447,6 @@ async def test_streaming_response_list_subscriptions(self, async_client: AsyncKn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_subscriptions(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1562,7 +1454,6 @@ async def test_path_params_list_subscriptions(self, async_client: AsyncKnock) -> user_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_merge(self, async_client: AsyncKnock) -> None: user = await async_client.users.merge( @@ -1571,7 +1462,6 @@ async def test_method_merge(self, async_client: AsyncKnock) -> None: ) assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_merge(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.merge( @@ -1584,7 +1474,6 @@ async def test_raw_response_merge(self, async_client: AsyncKnock) -> None: user = await response.parse() assert_matches_type(User, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_merge(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.merge( @@ -1599,7 +1488,6 @@ async def test_streaming_response_merge(self, async_client: AsyncKnock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_merge(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1608,7 +1496,6 @@ async def test_path_params_merge(self, async_client: AsyncKnock) -> None: from_user_id="user_1", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_channel_data(self, async_client: AsyncKnock) -> None: user = await async_client.users.set_channel_data( @@ -1618,7 +1505,6 @@ async def test_method_set_channel_data(self, async_client: AsyncKnock) -> None: ) assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_channel_data_with_all_params(self, async_client: AsyncKnock) -> None: user = await async_client.users.set_channel_data( @@ -1628,7 +1514,6 @@ async def test_method_set_channel_data_with_all_params(self, async_client: Async ) assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set_channel_data(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.set_channel_data( @@ -1642,7 +1527,6 @@ async def test_raw_response_set_channel_data(self, async_client: AsyncKnock) -> user = await response.parse() assert_matches_type(ChannelData, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set_channel_data(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.set_channel_data( @@ -1658,7 +1542,6 @@ async def test_streaming_response_set_channel_data(self, async_client: AsyncKnoc assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_set_channel_data(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1675,7 +1558,6 @@ async def test_path_params_set_channel_data(self, async_client: AsyncKnock) -> N data={"tokens": ["push_token_1"]}, ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_preferences(self, async_client: AsyncKnock) -> None: user = await async_client.users.set_preferences( @@ -1684,7 +1566,6 @@ async def test_method_set_preferences(self, async_client: AsyncKnock) -> None: ) assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_preferences_with_all_params(self, async_client: AsyncKnock) -> None: user = await async_client.users.set_preferences( @@ -1780,7 +1661,6 @@ async def test_method_set_preferences_with_all_params(self, async_client: AsyncK ) assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set_preferences(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.set_preferences( @@ -1793,7 +1673,6 @@ async def test_raw_response_set_preferences(self, async_client: AsyncKnock) -> N user = await response.parse() assert_matches_type(PreferenceSet, user, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set_preferences(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.set_preferences( @@ -1808,7 +1687,6 @@ async def test_streaming_response_set_preferences(self, async_client: AsyncKnock assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_set_preferences(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -1823,7 +1701,6 @@ async def test_path_params_set_preferences(self, async_client: AsyncKnock) -> No id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_unset_channel_data(self, async_client: AsyncKnock) -> None: user = await async_client.users.unset_channel_data( @@ -1832,7 +1709,6 @@ async def test_method_unset_channel_data(self, async_client: AsyncKnock) -> None ) assert user is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_unset_channel_data(self, async_client: AsyncKnock) -> None: response = await async_client.users.with_raw_response.unset_channel_data( @@ -1845,7 +1721,6 @@ async def test_raw_response_unset_channel_data(self, async_client: AsyncKnock) - user = await response.parse() assert user is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_unset_channel_data(self, async_client: AsyncKnock) -> None: async with async_client.users.with_streaming_response.unset_channel_data( @@ -1860,7 +1735,6 @@ async def test_streaming_response_unset_channel_data(self, async_client: AsyncKn assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_unset_channel_data(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): diff --git a/tests/api_resources/test_workflows.py b/tests/api_resources/test_workflows.py index 3c175307..76532392 100644 --- a/tests/api_resources/test_workflows.py +++ b/tests/api_resources/test_workflows.py @@ -19,7 +19,6 @@ class TestWorkflows: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_cancel(self, client: Knock) -> None: workflow = client.workflows.cancel( @@ -28,7 +27,6 @@ def test_method_cancel(self, client: Knock) -> None: ) assert workflow is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_cancel_with_all_params(self, client: Knock) -> None: workflow = client.workflows.cancel( @@ -38,7 +36,6 @@ def test_method_cancel_with_all_params(self, client: Knock) -> None: ) assert workflow is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_cancel(self, client: Knock) -> None: response = client.workflows.with_raw_response.cancel( @@ -51,7 +48,6 @@ def test_raw_response_cancel(self, client: Knock) -> None: workflow = response.parse() assert workflow is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_cancel(self, client: Knock) -> None: with client.workflows.with_streaming_response.cancel( @@ -66,7 +62,6 @@ def test_streaming_response_cancel(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_cancel(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): @@ -75,7 +70,6 @@ def test_path_params_cancel(self, client: Knock) -> None: cancellation_key="cancel-workflow-123", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_trigger(self, client: Knock) -> None: workflow = client.workflows.trigger( @@ -84,7 +78,6 @@ def test_method_trigger(self, client: Knock) -> None: ) assert_matches_type(WorkflowTriggerResponse, workflow, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_trigger_with_all_params(self, client: Knock) -> None: workflow = client.workflows.trigger( @@ -104,7 +97,6 @@ def test_method_trigger_with_all_params(self, client: Knock) -> None: ) assert_matches_type(WorkflowTriggerResponse, workflow, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_trigger(self, client: Knock) -> None: response = client.workflows.with_raw_response.trigger( @@ -117,7 +109,6 @@ def test_raw_response_trigger(self, client: Knock) -> None: workflow = response.parse() assert_matches_type(WorkflowTriggerResponse, workflow, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_trigger(self, client: Knock) -> None: with client.workflows.with_streaming_response.trigger( @@ -132,7 +123,6 @@ def test_streaming_response_trigger(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_trigger(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): @@ -147,7 +137,6 @@ class TestAsyncWorkflows: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_cancel(self, async_client: AsyncKnock) -> None: workflow = await async_client.workflows.cancel( @@ -156,7 +145,6 @@ async def test_method_cancel(self, async_client: AsyncKnock) -> None: ) assert workflow is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_cancel_with_all_params(self, async_client: AsyncKnock) -> None: workflow = await async_client.workflows.cancel( @@ -166,7 +154,6 @@ async def test_method_cancel_with_all_params(self, async_client: AsyncKnock) -> ) assert workflow is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_cancel(self, async_client: AsyncKnock) -> None: response = await async_client.workflows.with_raw_response.cancel( @@ -179,7 +166,6 @@ async def test_raw_response_cancel(self, async_client: AsyncKnock) -> None: workflow = await response.parse() assert workflow is None - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_cancel(self, async_client: AsyncKnock) -> None: async with async_client.workflows.with_streaming_response.cancel( @@ -194,7 +180,6 @@ async def test_streaming_response_cancel(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_cancel(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): @@ -203,7 +188,6 @@ async def test_path_params_cancel(self, async_client: AsyncKnock) -> None: cancellation_key="cancel-workflow-123", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_trigger(self, async_client: AsyncKnock) -> None: workflow = await async_client.workflows.trigger( @@ -212,7 +196,6 @@ async def test_method_trigger(self, async_client: AsyncKnock) -> None: ) assert_matches_type(WorkflowTriggerResponse, workflow, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_trigger_with_all_params(self, async_client: AsyncKnock) -> None: workflow = await async_client.workflows.trigger( @@ -232,7 +215,6 @@ async def test_method_trigger_with_all_params(self, async_client: AsyncKnock) -> ) assert_matches_type(WorkflowTriggerResponse, workflow, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_trigger(self, async_client: AsyncKnock) -> None: response = await async_client.workflows.with_raw_response.trigger( @@ -245,7 +227,6 @@ async def test_raw_response_trigger(self, async_client: AsyncKnock) -> None: workflow = await response.parse() assert_matches_type(WorkflowTriggerResponse, workflow, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_trigger(self, async_client: AsyncKnock) -> None: async with async_client.workflows.with_streaming_response.trigger( @@ -260,7 +241,6 @@ async def test_streaming_response_trigger(self, async_client: AsyncKnock) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_trigger(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): diff --git a/tests/api_resources/users/test_bulk.py b/tests/api_resources/users/test_bulk.py index d7acf43f..a73d8264 100644 --- a/tests/api_resources/users/test_bulk.py +++ b/tests/api_resources/users/test_bulk.py @@ -17,7 +17,6 @@ class TestBulk: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_delete(self, client: Knock) -> None: bulk = client.users.bulk.delete( @@ -25,7 +24,6 @@ def test_method_delete(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_delete(self, client: Knock) -> None: response = client.users.bulk.with_raw_response.delete( @@ -37,7 +35,6 @@ def test_raw_response_delete(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_delete(self, client: Knock) -> None: with client.users.bulk.with_streaming_response.delete( @@ -51,7 +48,6 @@ def test_streaming_response_delete(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_identify(self, client: Knock) -> None: bulk = client.users.bulk.identify( @@ -59,7 +55,6 @@ def test_method_identify(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_identify(self, client: Knock) -> None: response = client.users.bulk.with_raw_response.identify( @@ -71,7 +66,6 @@ def test_raw_response_identify(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_identify(self, client: Knock) -> None: with client.users.bulk.with_streaming_response.identify( @@ -85,7 +79,6 @@ def test_streaming_response_identify(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_preferences(self, client: Knock) -> None: bulk = client.users.bulk.set_preferences( @@ -94,7 +87,6 @@ def test_method_set_preferences(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_set_preferences_with_all_params(self, client: Knock) -> None: bulk = client.users.bulk.set_preferences( @@ -191,7 +183,6 @@ def test_method_set_preferences_with_all_params(self, client: Knock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_set_preferences(self, client: Knock) -> None: response = client.users.bulk.with_raw_response.set_preferences( @@ -204,7 +195,6 @@ def test_raw_response_set_preferences(self, client: Knock) -> None: bulk = response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_set_preferences(self, client: Knock) -> None: with client.users.bulk.with_streaming_response.set_preferences( @@ -225,7 +215,6 @@ class TestAsyncBulk: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_delete(self, async_client: AsyncKnock) -> None: bulk = await async_client.users.bulk.delete( @@ -233,7 +222,6 @@ async def test_method_delete(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: response = await async_client.users.bulk.with_raw_response.delete( @@ -245,7 +233,6 @@ async def test_raw_response_delete(self, async_client: AsyncKnock) -> None: bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None: async with async_client.users.bulk.with_streaming_response.delete( @@ -259,7 +246,6 @@ async def test_streaming_response_delete(self, async_client: AsyncKnock) -> None assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_identify(self, async_client: AsyncKnock) -> None: bulk = await async_client.users.bulk.identify( @@ -267,7 +253,6 @@ async def test_method_identify(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_identify(self, async_client: AsyncKnock) -> None: response = await async_client.users.bulk.with_raw_response.identify( @@ -279,7 +264,6 @@ async def test_raw_response_identify(self, async_client: AsyncKnock) -> None: bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_identify(self, async_client: AsyncKnock) -> None: async with async_client.users.bulk.with_streaming_response.identify( @@ -293,7 +277,6 @@ async def test_streaming_response_identify(self, async_client: AsyncKnock) -> No assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_preferences(self, async_client: AsyncKnock) -> None: bulk = await async_client.users.bulk.set_preferences( @@ -302,7 +285,6 @@ async def test_method_set_preferences(self, async_client: AsyncKnock) -> None: ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_set_preferences_with_all_params(self, async_client: AsyncKnock) -> None: bulk = await async_client.users.bulk.set_preferences( @@ -399,7 +381,6 @@ async def test_method_set_preferences_with_all_params(self, async_client: AsyncK ) assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_set_preferences(self, async_client: AsyncKnock) -> None: response = await async_client.users.bulk.with_raw_response.set_preferences( @@ -412,7 +393,6 @@ async def test_raw_response_set_preferences(self, async_client: AsyncKnock) -> N bulk = await response.parse() assert_matches_type(BulkOperation, bulk, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_set_preferences(self, async_client: AsyncKnock) -> None: async with async_client.users.bulk.with_streaming_response.set_preferences( diff --git a/tests/api_resources/users/test_feeds.py b/tests/api_resources/users/test_feeds.py index 84b97f6a..4236faba 100644 --- a/tests/api_resources/users/test_feeds.py +++ b/tests/api_resources/users/test_feeds.py @@ -18,7 +18,6 @@ class TestFeeds: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_settings(self, client: Knock) -> None: feed = client.users.feeds.get_settings( @@ -27,7 +26,6 @@ def test_method_get_settings(self, client: Knock) -> None: ) assert_matches_type(FeedGetSettingsResponse, feed, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get_settings(self, client: Knock) -> None: response = client.users.feeds.with_raw_response.get_settings( @@ -40,7 +38,6 @@ def test_raw_response_get_settings(self, client: Knock) -> None: feed = response.parse() assert_matches_type(FeedGetSettingsResponse, feed, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get_settings(self, client: Knock) -> None: with client.users.feeds.with_streaming_response.get_settings( @@ -55,7 +52,6 @@ def test_streaming_response_get_settings(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get_settings(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -70,7 +66,6 @@ def test_path_params_get_settings(self, client: Knock) -> None: id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_items(self, client: Knock) -> None: feed = client.users.feeds.list_items( @@ -79,7 +74,6 @@ def test_method_list_items(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[FeedListItemsResponse], feed, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_list_items_with_all_params(self, client: Knock) -> None: feed = client.users.feeds.list_items( @@ -107,7 +101,6 @@ def test_method_list_items_with_all_params(self, client: Knock) -> None: ) assert_matches_type(SyncEntriesCursor[FeedListItemsResponse], feed, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_list_items(self, client: Knock) -> None: response = client.users.feeds.with_raw_response.list_items( @@ -120,7 +113,6 @@ def test_raw_response_list_items(self, client: Knock) -> None: feed = response.parse() assert_matches_type(SyncEntriesCursor[FeedListItemsResponse], feed, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_list_items(self, client: Knock) -> None: with client.users.feeds.with_streaming_response.list_items( @@ -135,7 +127,6 @@ def test_streaming_response_list_items(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_list_items(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -156,7 +147,6 @@ class TestAsyncFeeds: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_settings(self, async_client: AsyncKnock) -> None: feed = await async_client.users.feeds.get_settings( @@ -165,7 +155,6 @@ async def test_method_get_settings(self, async_client: AsyncKnock) -> None: ) assert_matches_type(FeedGetSettingsResponse, feed, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get_settings(self, async_client: AsyncKnock) -> None: response = await async_client.users.feeds.with_raw_response.get_settings( @@ -178,7 +167,6 @@ async def test_raw_response_get_settings(self, async_client: AsyncKnock) -> None feed = await response.parse() assert_matches_type(FeedGetSettingsResponse, feed, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get_settings(self, async_client: AsyncKnock) -> None: async with async_client.users.feeds.with_streaming_response.get_settings( @@ -193,7 +181,6 @@ async def test_streaming_response_get_settings(self, async_client: AsyncKnock) - assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get_settings(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -208,7 +195,6 @@ async def test_path_params_get_settings(self, async_client: AsyncKnock) -> None: id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_items(self, async_client: AsyncKnock) -> None: feed = await async_client.users.feeds.list_items( @@ -217,7 +203,6 @@ async def test_method_list_items(self, async_client: AsyncKnock) -> None: ) assert_matches_type(AsyncEntriesCursor[FeedListItemsResponse], feed, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_list_items_with_all_params(self, async_client: AsyncKnock) -> None: feed = await async_client.users.feeds.list_items( @@ -245,7 +230,6 @@ async def test_method_list_items_with_all_params(self, async_client: AsyncKnock) ) assert_matches_type(AsyncEntriesCursor[FeedListItemsResponse], feed, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_list_items(self, async_client: AsyncKnock) -> None: response = await async_client.users.feeds.with_raw_response.list_items( @@ -258,7 +242,6 @@ async def test_raw_response_list_items(self, async_client: AsyncKnock) -> None: feed = await response.parse() assert_matches_type(AsyncEntriesCursor[FeedListItemsResponse], feed, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_list_items(self, async_client: AsyncKnock) -> None: async with async_client.users.feeds.with_streaming_response.list_items( @@ -273,7 +256,6 @@ async def test_streaming_response_list_items(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_list_items(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): diff --git a/tests/api_resources/users/test_guides.py b/tests/api_resources/users/test_guides.py index d8c95e8c..fec1ddd9 100644 --- a/tests/api_resources/users/test_guides.py +++ b/tests/api_resources/users/test_guides.py @@ -22,7 +22,6 @@ class TestGuides: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_channel(self, client: Knock) -> None: guide = client.users.guides.get_channel( @@ -31,7 +30,6 @@ def test_method_get_channel(self, client: Knock) -> None: ) assert_matches_type(GuideGetChannelResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_get_channel_with_all_params(self, client: Knock) -> None: guide = client.users.guides.get_channel( @@ -43,7 +41,6 @@ def test_method_get_channel_with_all_params(self, client: Knock) -> None: ) assert_matches_type(GuideGetChannelResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_get_channel(self, client: Knock) -> None: response = client.users.guides.with_raw_response.get_channel( @@ -56,7 +53,6 @@ def test_raw_response_get_channel(self, client: Knock) -> None: guide = response.parse() assert_matches_type(GuideGetChannelResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_get_channel(self, client: Knock) -> None: with client.users.guides.with_streaming_response.get_channel( @@ -71,7 +67,6 @@ def test_streaming_response_get_channel(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_get_channel(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -86,7 +81,6 @@ def test_path_params_get_channel(self, client: Knock) -> None: channel_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_message_as_archived(self, client: Knock) -> None: guide = client.users.guides.mark_message_as_archived( @@ -99,7 +93,6 @@ def test_method_mark_message_as_archived(self, client: Knock) -> None: ) assert_matches_type(GuideMarkMessageAsArchivedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_message_as_archived_with_all_params(self, client: Knock) -> None: guide = client.users.guides.mark_message_as_archived( @@ -128,7 +121,6 @@ def test_method_mark_message_as_archived_with_all_params(self, client: Knock) -> ) assert_matches_type(GuideMarkMessageAsArchivedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_message_as_archived(self, client: Knock) -> None: response = client.users.guides.with_raw_response.mark_message_as_archived( @@ -145,7 +137,6 @@ def test_raw_response_mark_message_as_archived(self, client: Knock) -> None: guide = response.parse() assert_matches_type(GuideMarkMessageAsArchivedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_message_as_archived(self, client: Knock) -> None: with client.users.guides.with_streaming_response.mark_message_as_archived( @@ -164,7 +155,6 @@ def test_streaming_response_mark_message_as_archived(self, client: Knock) -> Non assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_mark_message_as_archived(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -187,7 +177,6 @@ def test_path_params_mark_message_as_archived(self, client: Knock) -> None: guide_step_ref="lab_tours", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_message_as_interacted(self, client: Knock) -> None: guide = client.users.guides.mark_message_as_interacted( @@ -200,7 +189,6 @@ def test_method_mark_message_as_interacted(self, client: Knock) -> None: ) assert_matches_type(GuideMarkMessageAsInteractedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_message_as_interacted_with_all_params(self, client: Knock) -> None: guide = client.users.guides.mark_message_as_interacted( @@ -229,7 +217,6 @@ def test_method_mark_message_as_interacted_with_all_params(self, client: Knock) ) assert_matches_type(GuideMarkMessageAsInteractedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_message_as_interacted(self, client: Knock) -> None: response = client.users.guides.with_raw_response.mark_message_as_interacted( @@ -246,7 +233,6 @@ def test_raw_response_mark_message_as_interacted(self, client: Knock) -> None: guide = response.parse() assert_matches_type(GuideMarkMessageAsInteractedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_message_as_interacted(self, client: Knock) -> None: with client.users.guides.with_streaming_response.mark_message_as_interacted( @@ -265,7 +251,6 @@ def test_streaming_response_mark_message_as_interacted(self, client: Knock) -> N assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_mark_message_as_interacted(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -288,7 +273,6 @@ def test_path_params_mark_message_as_interacted(self, client: Knock) -> None: guide_step_ref="lab_tours", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_message_as_seen(self, client: Knock) -> None: guide = client.users.guides.mark_message_as_seen( @@ -301,7 +285,6 @@ def test_method_mark_message_as_seen(self, client: Knock) -> None: ) assert_matches_type(GuideMarkMessageAsSeenResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_method_mark_message_as_seen_with_all_params(self, client: Knock) -> None: guide = client.users.guides.mark_message_as_seen( @@ -330,7 +313,6 @@ def test_method_mark_message_as_seen_with_all_params(self, client: Knock) -> Non ) assert_matches_type(GuideMarkMessageAsSeenResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_raw_response_mark_message_as_seen(self, client: Knock) -> None: response = client.users.guides.with_raw_response.mark_message_as_seen( @@ -347,7 +329,6 @@ def test_raw_response_mark_message_as_seen(self, client: Knock) -> None: guide = response.parse() assert_matches_type(GuideMarkMessageAsSeenResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_streaming_response_mark_message_as_seen(self, client: Knock) -> None: with client.users.guides.with_streaming_response.mark_message_as_seen( @@ -366,7 +347,6 @@ def test_streaming_response_mark_message_as_seen(self, client: Knock) -> None: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize def test_path_params_mark_message_as_seen(self, client: Knock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -395,7 +375,6 @@ class TestAsyncGuides: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_channel(self, async_client: AsyncKnock) -> None: guide = await async_client.users.guides.get_channel( @@ -404,7 +383,6 @@ async def test_method_get_channel(self, async_client: AsyncKnock) -> None: ) assert_matches_type(GuideGetChannelResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_get_channel_with_all_params(self, async_client: AsyncKnock) -> None: guide = await async_client.users.guides.get_channel( @@ -416,7 +394,6 @@ async def test_method_get_channel_with_all_params(self, async_client: AsyncKnock ) assert_matches_type(GuideGetChannelResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_get_channel(self, async_client: AsyncKnock) -> None: response = await async_client.users.guides.with_raw_response.get_channel( @@ -429,7 +406,6 @@ async def test_raw_response_get_channel(self, async_client: AsyncKnock) -> None: guide = await response.parse() assert_matches_type(GuideGetChannelResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_get_channel(self, async_client: AsyncKnock) -> None: async with async_client.users.guides.with_streaming_response.get_channel( @@ -444,7 +420,6 @@ async def test_streaming_response_get_channel(self, async_client: AsyncKnock) -> assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_get_channel(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -459,7 +434,6 @@ async def test_path_params_get_channel(self, async_client: AsyncKnock) -> None: channel_id="", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_message_as_archived(self, async_client: AsyncKnock) -> None: guide = await async_client.users.guides.mark_message_as_archived( @@ -472,7 +446,6 @@ async def test_method_mark_message_as_archived(self, async_client: AsyncKnock) - ) assert_matches_type(GuideMarkMessageAsArchivedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_message_as_archived_with_all_params(self, async_client: AsyncKnock) -> None: guide = await async_client.users.guides.mark_message_as_archived( @@ -501,7 +474,6 @@ async def test_method_mark_message_as_archived_with_all_params(self, async_clien ) assert_matches_type(GuideMarkMessageAsArchivedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_message_as_archived(self, async_client: AsyncKnock) -> None: response = await async_client.users.guides.with_raw_response.mark_message_as_archived( @@ -518,7 +490,6 @@ async def test_raw_response_mark_message_as_archived(self, async_client: AsyncKn guide = await response.parse() assert_matches_type(GuideMarkMessageAsArchivedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_message_as_archived(self, async_client: AsyncKnock) -> None: async with async_client.users.guides.with_streaming_response.mark_message_as_archived( @@ -537,7 +508,6 @@ async def test_streaming_response_mark_message_as_archived(self, async_client: A assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_mark_message_as_archived(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -560,7 +530,6 @@ async def test_path_params_mark_message_as_archived(self, async_client: AsyncKno guide_step_ref="lab_tours", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_message_as_interacted(self, async_client: AsyncKnock) -> None: guide = await async_client.users.guides.mark_message_as_interacted( @@ -573,7 +542,6 @@ async def test_method_mark_message_as_interacted(self, async_client: AsyncKnock) ) assert_matches_type(GuideMarkMessageAsInteractedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_message_as_interacted_with_all_params(self, async_client: AsyncKnock) -> None: guide = await async_client.users.guides.mark_message_as_interacted( @@ -602,7 +570,6 @@ async def test_method_mark_message_as_interacted_with_all_params(self, async_cli ) assert_matches_type(GuideMarkMessageAsInteractedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_message_as_interacted(self, async_client: AsyncKnock) -> None: response = await async_client.users.guides.with_raw_response.mark_message_as_interacted( @@ -619,7 +586,6 @@ async def test_raw_response_mark_message_as_interacted(self, async_client: Async guide = await response.parse() assert_matches_type(GuideMarkMessageAsInteractedResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_message_as_interacted(self, async_client: AsyncKnock) -> None: async with async_client.users.guides.with_streaming_response.mark_message_as_interacted( @@ -638,7 +604,6 @@ async def test_streaming_response_mark_message_as_interacted(self, async_client: assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_mark_message_as_interacted(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): @@ -661,7 +626,6 @@ async def test_path_params_mark_message_as_interacted(self, async_client: AsyncK guide_step_ref="lab_tours", ) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_message_as_seen(self, async_client: AsyncKnock) -> None: guide = await async_client.users.guides.mark_message_as_seen( @@ -674,7 +638,6 @@ async def test_method_mark_message_as_seen(self, async_client: AsyncKnock) -> No ) assert_matches_type(GuideMarkMessageAsSeenResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_method_mark_message_as_seen_with_all_params(self, async_client: AsyncKnock) -> None: guide = await async_client.users.guides.mark_message_as_seen( @@ -703,7 +666,6 @@ async def test_method_mark_message_as_seen_with_all_params(self, async_client: A ) assert_matches_type(GuideMarkMessageAsSeenResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_raw_response_mark_message_as_seen(self, async_client: AsyncKnock) -> None: response = await async_client.users.guides.with_raw_response.mark_message_as_seen( @@ -720,7 +682,6 @@ async def test_raw_response_mark_message_as_seen(self, async_client: AsyncKnock) guide = await response.parse() assert_matches_type(GuideMarkMessageAsSeenResponse, guide, path=["response"]) - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_streaming_response_mark_message_as_seen(self, async_client: AsyncKnock) -> None: async with async_client.users.guides.with_streaming_response.mark_message_as_seen( @@ -739,7 +700,6 @@ async def test_streaming_response_mark_message_as_seen(self, async_client: Async assert cast(Any, response.is_closed) is True - @pytest.mark.skip(reason="Mock server doesn't support callbacks yet") @parametrize async def test_path_params_mark_message_as_seen(self, async_client: AsyncKnock) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): diff --git a/tests/test_utils/test_path.py b/tests/test_utils/test_path.py new file mode 100644 index 00000000..4740481f --- /dev/null +++ b/tests/test_utils/test_path.py @@ -0,0 +1,89 @@ +from __future__ import annotations + +from typing import Any + +import pytest + +from knockapi._utils._path import path_template + + +@pytest.mark.parametrize( + "template, kwargs, expected", + [ + ("/v1/{id}", dict(id="abc"), "/v1/abc"), + ("/v1/{a}/{b}", dict(a="x", b="y"), "/v1/x/y"), + ("/v1/{a}{b}/path/{c}?val={d}#{e}", dict(a="x", b="y", c="z", d="u", e="v"), "/v1/xy/path/z?val=u#v"), + ("/{w}/{w}", dict(w="echo"), "/echo/echo"), + ("/v1/static", {}, "/v1/static"), + ("", {}, ""), + ("/v1/?q={n}&count=10", dict(n=42), "/v1/?q=42&count=10"), + ("/v1/{v}", dict(v=None), "/v1/null"), + ("/v1/{v}", dict(v=True), "/v1/true"), + ("/v1/{v}", dict(v=False), "/v1/false"), + ("/v1/{v}", dict(v=".hidden"), "/v1/.hidden"), # dot prefix ok + ("/v1/{v}", dict(v="file.txt"), "/v1/file.txt"), # dot in middle ok + ("/v1/{v}", dict(v="..."), "/v1/..."), # triple dot ok + ("/v1/{a}{b}", dict(a=".", b="txt"), "/v1/.txt"), # dot var combining with adjacent to be ok + ("/items?q={v}#{f}", dict(v=".", f=".."), "/items?q=.#.."), # dots in query/fragment are fine + ( + "/v1/{a}?query={b}", + dict(a="../../other/endpoint", b="a&bad=true"), + "/v1/..%2F..%2Fother%2Fendpoint?query=a%26bad%3Dtrue", + ), + ("/v1/{val}", dict(val="a/b/c"), "/v1/a%2Fb%2Fc"), + ("/v1/{val}", dict(val="a/b/c?query=value"), "/v1/a%2Fb%2Fc%3Fquery=value"), + ("/v1/{val}", dict(val="a/b/c?query=value&bad=true"), "/v1/a%2Fb%2Fc%3Fquery=value&bad=true"), + ("/v1/{val}", dict(val="%20"), "/v1/%2520"), # escapes escape sequences in input + # Query: slash and ? are safe, # is not + ("/items?q={v}", dict(v="a/b"), "/items?q=a/b"), + ("/items?q={v}", dict(v="a?b"), "/items?q=a?b"), + ("/items?q={v}", dict(v="a#b"), "/items?q=a%23b"), + ("/items?q={v}", dict(v="a b"), "/items?q=a%20b"), + # Fragment: slash and ? are safe + ("/docs#{v}", dict(v="a/b"), "/docs#a/b"), + ("/docs#{v}", dict(v="a?b"), "/docs#a?b"), + # Path: slash, ? and # are all encoded + ("/v1/{v}", dict(v="a/b"), "/v1/a%2Fb"), + ("/v1/{v}", dict(v="a?b"), "/v1/a%3Fb"), + ("/v1/{v}", dict(v="a#b"), "/v1/a%23b"), + # same var encoded differently by component + ( + "/v1/{v}?q={v}#{v}", + dict(v="a/b?c#d"), + "/v1/a%2Fb%3Fc%23d?q=a/b?c%23d#a/b?c%23d", + ), + ("/v1/{val}", dict(val="x?admin=true"), "/v1/x%3Fadmin=true"), # query injection + ("/v1/{val}", dict(val="x#admin"), "/v1/x%23admin"), # fragment injection + ], +) +def test_interpolation(template: str, kwargs: dict[str, Any], expected: str) -> None: + assert path_template(template, **kwargs) == expected + + +def test_missing_kwarg_raises_key_error() -> None: + with pytest.raises(KeyError, match="org_id"): + path_template("/v1/{org_id}") + + +@pytest.mark.parametrize( + "template, kwargs", + [ + ("{a}/path", dict(a=".")), + ("{a}/path", dict(a="..")), + ("/v1/{a}", dict(a=".")), + ("/v1/{a}", dict(a="..")), + ("/v1/{a}/path", dict(a=".")), + ("/v1/{a}/path", dict(a="..")), + ("/v1/{a}{b}", dict(a=".", b=".")), # adjacent vars → ".." + ("/v1/{a}.", dict(a=".")), # var + static → ".." + ("/v1/{a}{b}", dict(a="", b=".")), # empty + dot → "." + ("/v1/%2e/{x}", dict(x="ok")), # encoded dot in static text + ("/v1/%2e./{x}", dict(x="ok")), # mixed encoded ".." in static + ("/v1/.%2E/{x}", dict(x="ok")), # mixed encoded ".." in static + ("/v1/{v}?q=1", dict(v="..")), + ("/v1/{v}#frag", dict(v="..")), + ], +) +def test_dot_segment_rejected(template: str, kwargs: dict[str, Any]) -> None: + with pytest.raises(ValueError, match="dot-segment"): + path_template(template, **kwargs)