Exemplo n.º 1
0
class DescribeOpenChannel(_BaseTestCase):
    def configure(self):
        self.agent = ConsumerAgent(sentinel.consumer, sentinel.broker,
                                   sentinel.bindings)
        self.agent.connection = MagicMock()
        self.agent.on_channel_open = sentinel.on_channel_open

    def execute(self):
        self.agent.open_channel()

    def should_create_channel(self):
        self.agent.connection.channel.assert_called_once_with(
            on_open_callback=sentinel.on_channel_open)
Exemplo n.º 2
0
class DescribeOpenChannel(_BaseTestCase):

    def configure(self):
        self.agent = ConsumerAgent(sentinel.consumer, sentinel.broker,
                                   sentinel.bindings)
        self.agent.connection = MagicMock()
        self.agent.on_channel_open = sentinel.on_channel_open

    def execute(self):
        self.agent.open_channel()

    def should_create_channel(self):
        self.agent.connection.channel.assert_called_once_with(
            on_open_callback=sentinel.on_channel_open)