PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/tests/core/test_ipc.py

https://bitbucket.org/prologic/circuits/
Python | 31 lines | 18 code | 11 blank | 2 comment | 0 complexity | e8de1830b009179cbefb4a4a4d88ce0e MD5 | raw file
 1#!/usr/bin/env python
 2
 3import pytest
 4
 5from circuits import handler, Event, Component, Manager
 6
 7class Hello(Event):
 8    """Hello Event"""
 9
10class App(Component):
11
12    def hello(self):
13        return "Hello World!"
14
15def test():
16    m = Manager()
17    m.start()
18
19    app = App()
20    app.start(link=m, process=True)
21
22    assert pytest.wait_for(app._bridge, "ready")
23
24    x = m.fire(Hello())
25
26    assert pytest.wait_for(x, "result")
27    s = str(x)
28    assert s == "Hello World!"
29
30    m.stop()
31    app.stop()