Files
clan-core/pkgs/clan-cli/clan_cli/deal.py
2023-11-23 17:32:37 +01:00

22 lines
447 B
Python

from types import ModuleType
from typing import Any, Callable
class FakeDeal:
def __getattr__(self, name: str) -> "Callable":
return self.mock_call
def mock_call(self, *args: Any, **kwargs: Any) -> Callable:
def wrapper(func: Callable) -> Callable:
return func
return wrapper
try:
import deal as real_deal
deal: ModuleType | FakeDeal = real_deal
except ImportError:
deal = FakeDeal()