MCPcopy
hub / github.com/pika/pika / test_close_basic_cancel_called

Method test_close_basic_cancel_called

tests/unit/channel_tests.py:670–677  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

668 self.assertEqual(self.obj._state, channel.Channel.CLOSING)
669
670 def test_close_basic_cancel_called(self):
671 self.obj._set_state(self.obj.OPEN)
672 self.obj._consumers['abc'] = None
673 with mock.patch.object(self.obj, 'basic_cancel') as basic_cancel:
674 self.obj.close()
675 # this is actually not necessary but Pika currently cancels
676 # every consumer before closing the channel
677 basic_cancel.assert_called_once_with(consumer_tag='abc')
678
679 def test_close_basic_cancel_called_for_all_consumers(self):
680 self.obj._set_state(self.obj.OPEN)

Callers

nothing calls this directly

Calls 2

_set_stateMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected