From 1f191a6c13d9f29eaa25d1c6f8b2b56845876262 Mon Sep 17 00:00:00 2001 From: Steve Dignam Date: Sun, 30 Oct 2022 19:23:07 -0400 Subject: [PATCH] stripe: test clocks resource (#9026) Co-authored-by: Alex Waygood --- stubs/stripe/@tests/stubtest_allowlist.txt | 5 +++-- .../stripe/api_resources/test_helpers/__init__.pyi | 0 .../stripe/api_resources/test_helpers/test_clock.pyi | 11 +++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 stubs/stripe/stripe/api_resources/test_helpers/__init__.pyi create mode 100644 stubs/stripe/stripe/api_resources/test_helpers/test_clock.pyi diff --git a/stubs/stripe/@tests/stubtest_allowlist.txt b/stubs/stripe/@tests/stubtest_allowlist.txt index e4ac4827b..cd5b29f57 100644 --- a/stubs/stripe/@tests/stubtest_allowlist.txt +++ b/stubs/stripe/@tests/stubtest_allowlist.txt @@ -1,5 +1,6 @@ # The following methods have custom classmethod decorators stripe\..*\.delete stripe\..*PaymentIntent\.confirm -stripe\.api_resources\..*\.SearchableAPIResource\.search # Not defined on the actual class in v3, but expected to exist. -stripe\.api_resources\..*\.SearchableAPIResource\.search_auto_paging_iter # Not defined on the actual class in v3, but expected to exist. +stripe\.api_resources\.test_helpers\.test_clock\.TestClock\.advance +stripe\.api_resources\..*\.SearchableAPIResource\.search # Not defined on the actual class in v3, but expected to exist. +stripe\.api_resources\..*\.SearchableAPIResource\.search_auto_paging_iter # Not defined on the actual class in v3, but expected to exist. diff --git a/stubs/stripe/stripe/api_resources/test_helpers/__init__.pyi b/stubs/stripe/stripe/api_resources/test_helpers/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/stubs/stripe/stripe/api_resources/test_helpers/test_clock.pyi b/stubs/stripe/stripe/api_resources/test_helpers/test_clock.pyi new file mode 100644 index 000000000..86495c375 --- /dev/null +++ b/stubs/stripe/stripe/api_resources/test_helpers/test_clock.pyi @@ -0,0 +1,11 @@ +from _typeshed import Self +from typing import Any +from typing_extensions import Literal + +from stripe.api_resources.abstract import CreateableAPIResource, DeletableAPIResource, ListableAPIResource + +class TestClock(CreateableAPIResource, DeletableAPIResource, ListableAPIResource): + OBJECT_NAME: Literal["test_helpers.test_clock"] + + @classmethod + def advance(cls: type[Self], idempotency_key: str | None = ..., **params: Any) -> Self: ...