def test_close_with_callback(self): # with close callback cbmock = Mock() ch = BaseChannel(close_callback=cbmock) ch._fsm.current_state = ch.S_ACTIVE ch.close() cbmock.assert_called_once_with(ch)
def test_close(self): # without close callback transport = Mock() ch = BaseChannel() ch.on_channel_open(transport) ch._fsm.current_state = ch.S_ACTIVE ch.close() transport.close.assert_called_once_with()
def test_close(self): # without close callback ac = Mock() #pchannel.Channel) # cannot use this because callbacks is populated dynamically ch = BaseChannel() ch._amq_chan = ac ch._fsm.current_state = ch.S_ACTIVE ch.close() ac.close.assert_called_once_with() self.assertEquals(ac.callbacks.remove.call_count, 4)
def test_close(self): # without close callback ac = Mock( ) #pchannel.Channel) # cannot use this because callbacks is populated dynamically ch = BaseChannel() ch._amq_chan = ac ch._fsm.current_state = ch.S_ACTIVE ch.close() ac.close.assert_called_once_with() self.assertEquals(ac.callbacks.remove.call_count, 4)
def test_close(self): # with close callback cbmock = Mock() ch = BaseChannel(close_callback=cbmock) ch.close() cbmock.assert_called_once_with(ch) # without close callback ac = Mock() #pchannel.Channel) # cannot use this because callbacks is populated dynamically ch = BaseChannel() ch._amq_chan = ac ch.close() ac.close.assert_called_once_with() self.assertEquals(ac.callbacks.remove.call_count, 4)