def test__make_database_pool_creates_connected_pool(self): pool = threads.make_database_pool() self.assertThat(pool, IsInstance(ThreadPool)) self.assertThat(pool.context.contextFactory, Is(orm.FullyConnected)) self.assertThat(pool.max, Equals(threads.max_threads_for_database_pool)) self.assertThat(pool.min, Equals(0))
def test__make_database_pool_accepts_max_threads_setting(self): maxthreads = random.randint(1, 1000) pool = threads.make_database_pool(maxthreads) self.assertThat(pool.max, Equals(maxthreads)) self.assertThat(pool.min, Equals(0))