Ejemplo n.º 1
0
 def test_close(self):
     config = self._setup_config()
     pika_string = 'socorro.external.rabbitmq.connection_context.pika'
     with patch(pika_string):
         conn_context_functor = ConnectionContextPooled(config)
         conn_context_functor.connection()
         conn_context_functor.connection('dwight')
         conn_context_functor.connection('wilma')
         conn_context_functor.close()
         assert len(conn_context_functor.pool) == 0
Ejemplo n.º 2
0
 def test_close(self):
     config = self._setup_config()
     pika_string = 'socorro.external.rabbitmq.connection_context.pika'
     with patch(pika_string) as mocked_pika_module:
         conn_context_functor = ConnectionContextPooled(config)
         conn = conn_context_functor.connection()
         conn = conn_context_functor.connection('dwight')
         conn = conn_context_functor.connection('wilma')
         conn_context_functor.close()
         self.assertEqual(len(conn_context_functor.pool), 0)
Ejemplo n.º 3
0
 def test_close(self):
     config = self._setup_config()
     pika_string = 'socorro.external.rabbitmq.connection_context.pika'
     with patch(pika_string):
         conn_context_functor = ConnectionContextPooled(config)
         conn_context_functor.connection()
         conn_context_functor.connection('dwight')
         conn_context_functor.connection('wilma')
         conn_context_functor.close()
         eq_(len(conn_context_functor.pool), 0)