def test_checkout_after_shutdown_raises_exception(self): p = Pool(WidgetFactory()) p.shutdown() try: p.checkout() except Exception, e: pass # Success
def test_state_on_construction(self): p = Pool(WidgetFactory()) self.assertEquals(0, p.size()) self.assertEquals(0, p.available()) p.shutdown() self.assertEquals(0, p.size()) self.assertEquals(0, p.available())
def test_multiple_consumers(self): p = Pool(WidgetFactory()) numConsumers = 10 consumers = [] for c in xrange(numConsumers): consumers.append(self.multiple_consumers_thread(c, p, numConsumers)) for consumer in consumers: consumer.join() self.assertTrue(p.available() > 0) self.assertTrue(p.size() > 0) p.shutdown()
def test_multiple_consumers(self): p = Pool(WidgetFactory()) numConsumers = 10 consumers = [] for c in xrange(numConsumers): consumers.append(self.multiple_consumers_thread( c, p, numConsumers)) for consumer in consumers: consumer.join() self.assertTrue(p.available() > 0) self.assertTrue(p.size() > 0) p.shutdown()