def test_sending_two_noes(): # XXX fijal: this test previously tested that the second # item result would not get send. why? did i miss # something? # ch = DummyChannel() reportlist = [] mnode = MasterNode(ch, reportlist.append) mnode.send(Item("ok")) mnode.send(Item("ok")) ch.callback(Outcome().make_repr()) ch.callback(Outcome().make_repr()) assert len(reportlist) == 4
def test_masternode(): try: raise ValueError() except ValueError: excinfo = py.code.ExceptionInfo() ch = DummyChannel() reportlist = [] mnode = MasterNode(ch, reportlist.append) mnode.send(Item("ok")) mnode.send(Item("notok")) ch.callback(Outcome().make_repr()) ch.callback(Outcome(excinfo=excinfo).make_repr()) assert len(reportlist) == 4 received = [i for i in reportlist if isinstance(i, repevent.ReceivedItemOutcome)] assert received[0].outcome.passed assert not received[1].outcome.passed