mock.sentinel.testid

Here are the examples of the python api mock.sentinel.testid taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

Example 1

Project: pyon Source File: test_transport.py
    @patch('pyon.net.transport.os', new_callable=MagicMock)
    def test_declare_exchange_impl_queue_blame(self, osmock):
        osmock.environ.get.return_value = True
        osmock.environ.__getitem__.return_value = sentinel.testid

        self.tp.declare_exchange_impl(sentinel.exchange)

        self.tp._sync_call.assert_called_once_with(self.tp._client.exchange_declare,
                                                   'callback',
                                                   exchange=sentinel.exchange,
                                                   type='topic',
                                                   durable=False,
                                                   auto_delete=True,
                                                   arguments={'created-by':sentinel.testid})

Example 2

Project: pyon Source File: test_transport.py
    @patch('pyon.net.transport.os', new_callable=MagicMock)
    def test_declare_queue_impl_queue_blame(self, osmock):
        osmock.environ.get.return_value = True
        osmock.environ.__getitem__.return_value = sentinel.testid

        retqueue = self.tp.declare_queue_impl(sentinel.queue)

        self.tp._sync_call.assert_called_once_with(self.tp._client.queue_declare,
                                                   'callback',
                                                   queue=sentinel.queue,
                                                   durable=False,
                                                   auto_delete=True,
                                                   arguments={'created-by':sentinel.testid})

        self.assertEquals(retqueue, self.tp._sync_call.return_value.method.queue)