Exemplo n.º 1
0
    def test_unregistered(self, mock_gofer_agent):
        context = Mock()
        context.route = '123'
        context.secret = 'test-secret'
        context.url = 'http://broker.com'
        context.authenticator = Mock()

        mock_agent = Mock()
        mock_gofer_agent.return_value = mock_agent
        mock_consumer = Mock()
        mock_agent.Consumer = Mock(return_value=mock_consumer)

        # test capability

        Consumer.unregistered(context)

        # validation

        mock_gofer_agent.assert_called_with(
            context.url,
            context.route,
            secret=context.secret,
            authenticator=context.authenticator,
            wait=0)

        mock_consumer.unregistered.assert_called_with()
Exemplo n.º 2
0
    def test_unregistered(self, mock_gofer_agent):
        context = Mock()
        context.agent_id = "123"
        context.secret = "test-secret"
        context.url = "http://broker.com"
        context.transport = "qpid"
        context.authenticator = Mock()

        mock_agent = Mock()
        mock_gofer_agent.return_value = mock_agent
        mock_consumer = Mock()
        mock_agent.Consumer = Mock(return_value=mock_consumer)

        # test capability

        Consumer.unregistered(context)

        # validation

        mock_gofer_agent.assert_called_with(
            context.agent_id,
            url=context.url,
            secret=context.secret,
            authenticator=context.authenticator,
            transport=context.transport,
            async=True,
        )

        mock_consumer.unregistered.assert_called_with()
Exemplo n.º 3
0
    def test_unregistered(self, mock_gofer_agent):
        context = Mock()
        context.agent_id = '123'
        context.secret = 'test-secret'
        context.url = 'http://broker.com'
        context.transport = 'qpid'
        context.authenticator = Mock()

        mock_agent = Mock()
        mock_gofer_agent.return_value = mock_agent
        mock_consumer = Mock()
        mock_agent.Consumer = Mock(return_value=mock_consumer)

        # test capability

        Consumer.unregistered(context)

        # validation

        mock_gofer_agent.assert_called_with(
            context.agent_id,
            url=context.url,
            secret=context.secret,
            authenticator=context.authenticator,
            transport=context.transport,
            async=True)

        mock_consumer.unregistered.assert_called_with()