def test_signal(): main_t = dom.window.document.getElementById("main_table") msg = { "type": "ItemStart", "itemtype": "Module", "itemname": "foo.py", "fullitemname": "modules/foo.py", "length": 10, } webjs.process(msg) msg = { "type": "ReceivedItemOutcome", "fullmodulename": "modules/foo.py", "passed": "False", "fullitemname": "modules/foo.py/test_item", "hostkey": None, "signal": "10", "skipped": "False", } exported_methods.fail_reasons["modules/foo.py/test_item"] = "Received signal 10" exported_methods.stdout["modules/foo.py/test_item"] = "" exported_methods.stderr["modules/foo.py/test_item"] = "" webjs.process(msg) schedule_callbacks(exported_methods) # ouch assert ( dom.document.getElementById("modules/foo.py").childNodes[0].childNodes[0].childNodes[0].childNodes[0].nodeValue == "F" )
def test_signal(): main_t = dom.window.document.getElementById('main_table') msg = {'type': 'ItemStart', 'itemtype': 'Module', 'itemname': 'foo.py', 'fullitemname': 'modules/foo.py', 'length': 10, } webjs.process(msg) msg = {'type': 'ItemFinish', 'fullmodulename': 'modules/foo.py', 'passed' : 'False', 'fullitemname' : 'modules/foo.py/test_item', 'hostkey': None, 'signal': '10', 'skipped': 'False', } exported_methods.fail_reasons['modules/foo.py/test_item'] = 'Received signal 10' exported_methods.stdout['modules/foo.py/test_item'] = '' exported_methods.stderr['modules/foo.py/test_item'] = '' webjs.process(msg) schedule_callbacks(exported_methods) # ouch assert dom.document.getElementById('modules/foo.py').childNodes[0].\ childNodes[0].childNodes[0].childNodes[0].nodeValue == 'F'
def test_method_call(): class Meth(BasicExternal): @described(retval=int) def meth(self): return 8 l = [] def callback(i): l.append(i) meth = Meth() meth.meth(callback) schedule_callbacks(meth) assert l[0] == 8