for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import pytest
from groundwork.patterns.gw_threads_pattern import ThreadExistsException
def test_thread_plugin_activation(basicApp):
plugin = basicApp.plugins.get("ThreadPlugin")
assert plugin is not None
assert plugin.active is True
def test_thread_run(basicApp):
thread = plugin.threads.get("test_thread")
assert thread is not None
thread.run()
while thread.running:
pass
assert thread.response == "Done"
def test_thread_exists(basicApp):
with pytest.raises(ThreadExistsException):
plugin.threads.register("test_thread", None)