def setup(self): class Channel(pyamqp.Channel): wait_returns = [] def _x_open(self, *args, **kwargs): pass def wait(self, *args, **kwargs): return self.wait_returns def _send_method(self, *args, **kwargs): pass self.conn = Mock() self.conn._get_free_channel_id.side_effect = nextfun(count(0)) self.conn.channels = {} self.channel = Channel(self.conn, 0)
def setUp(self): if pyamqp is None: raise SkipTest('py-amqp not installed') class Channel(pyamqp.Channel): wait_returns = [] def _x_open(self, *args, **kwargs): pass def wait(self, *args, **kwargs): return self.wait_returns def _send_method(self, *args, **kwargs): pass self.conn = Mock() self.conn._get_free_channel_id.side_effect = nextfun(count(0)) self.conn.channels = {} self.channel = Channel(self.conn, 0)