fake_deal: fixup call wrapper
This commit is contained in:
@@ -1,13 +1,16 @@
|
|||||||
from types import ModuleType
|
from types import ModuleType
|
||||||
from typing import Callable
|
from typing import Any, Callable
|
||||||
|
|
||||||
|
|
||||||
class FakeDeal:
|
class FakeDeal:
|
||||||
def __getattr__(self, _name: str) -> "FakeDeal":
|
def __getattr__(self, name: str) -> "Callable":
|
||||||
return FakeDeal()
|
return self.mock_call
|
||||||
|
|
||||||
def __call__(self, func: Callable) -> Callable:
|
def mock_call(self, *args: Any, **kwargs: Any) -> Callable:
|
||||||
return func
|
def wrapper(func: Callable) -> Callable:
|
||||||
|
return func
|
||||||
|
|
||||||
|
return wrapper
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user