Beispiel #1
0
 def test__make_default_pool_creates_disconnected_pool(self):
     pool = threads.make_default_pool()
     self.assertThat(pool, IsInstance(ThreadPool))
     self.assertThat(pool.context.contextFactory,
                     Is(orm.TotallyDisconnected))
     self.assertThat(pool.max, Equals(threads.max_threads_for_default_pool))
     self.assertThat(pool.min, Equals(0))
Beispiel #2
0
 def test__make_default_pool_accepts_max_threads_setting(self):
     maxthreads = random.randint(1, 1000)
     pool = threads.make_default_pool(maxthreads)
     self.assertThat(pool.max, Equals(maxthreads))
     self.assertThat(pool.min, Equals(0))