feat: blackbox call

This commit is contained in:
Dan Chen
2024-03-21 15:59:35 +08:00
parent 726b926d98
commit 11e1659e22
12 changed files with 49 additions and 13 deletions

View File

@ -7,6 +7,9 @@ class Calculator(Blackbox):
"""This class just for example, it show how to implement Blackbox interface."""
def __call__(self, *args, **kwargs):
return self.processing(*args, **kwargs)
def valid(self, *args, **kwargs) -> bool:
data = args[0]
return isinstance(data, dict) and "op" in data and "left" in data and "right" in data