def test_basic_consume(self): tag = 'travis-ci' def on_consume_frame(*_): channel.rpc.on_frame(specification.Basic.ConsumeOk(tag)) connection = FakeConnection(on_write=on_consume_frame) channel = Channel(9, connection, 1) channel.set_state(Channel.OPEN) basic = Basic(channel) self.assertEqual(basic.consume(), tag)