Source code for zot.plugs.test

# zot/plugs/test.py
#
#

""" test plugin. """

## IMPORTS

from zot.errors import TestException
from zot.runtime import kernel
from zot.utils import error
from zot.fuzzy import random_str

import time

## CMNDS

[docs]def test(event): event.reply("yo!")
kernel.register("test", test)
[docs]def test_exception(event): raise TestException
kernel.register("test.exception", test_exception)
[docs]def test_wait(event): time.sleep(3.0) ; event.ok("slept")
kernel.register("test.wait", test_wait)
[docs]def test_random(event): event.reply(random_str())
kernel.register("test.random", test_random)