def test_repr(self): obj = Mock(name='cb') assert 'promise' in repr(ChannelPromise(obj)) obj.assert_not_called()
def test_set_on_return(self): chan = Mock() chan.events = defaultdict(Mock) p = Producer(ChannelPromise(lambda: chan), on_return='on_return') p.channel chan.events['basic_return'].add.assert_called_with('on_return')