/
servlamo
/
POP
Обзор
Документация
Войти
/
servlamo
/
POP
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
tests/contracts/test.py
33 строки
584 B
Tyler Johnson
Use the best loop for our needs
12 май 2021, 18:52
12 май 2021, 18:52
8976efb
Код
Авторство
О чём код?
""" Example contract """ __virtualname__ = "test" def functions(hub): """ Return the functions """ return ("ping", "demo") def pre_ping(hub, ctx): """ """ if len(ctx.args) != 1: raise Exception("ping does not take args!") if ctx.kwargs: raise Exception("ping does not take kwargs!") def call_ping(hub, ctx): """ """ print("calling!") return ctx.func(*ctx.args, **ctx.kwargs) def post_ping(hub, ctx): """ """ print("Calling Post!") if not isinstance(ctx.ret, dict): raise Exception("MUST BE DICT!!")