From d4bafa9017af924047d44884c26f6f7ed600b91d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 23 Nov 2023 17:32:37 +0100 Subject: [PATCH] fake_deal: fixup call wrapper --- pkgs/clan-cli/clan_cli/deal.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/deal.py b/pkgs/clan-cli/clan_cli/deal.py index ee57edd13..f60c3ab4e 100644 --- a/pkgs/clan-cli/clan_cli/deal.py +++ b/pkgs/clan-cli/clan_cli/deal.py @@ -1,13 +1,16 @@ from types import ModuleType -from typing import Callable +from typing import Any, Callable class FakeDeal: - def __getattr__(self, _name: str) -> "FakeDeal": - return FakeDeal() + def __getattr__(self, name: str) -> "Callable": + return self.mock_call - def __call__(self, func: Callable) -> Callable: - return func + def mock_call(self, *args: Any, **kwargs: Any) -> Callable: + def wrapper(func: Callable) -> Callable: + return func + + return wrapper try: