Esempio n. 1
0
 def setUp(self):
   self._patcher = mock.patch.object(queries, 'QueryBuilder')
   self._query_mock = self._patcher.start()
   self.addCleanup(self._patcher.stop)
   self._pool_patcher = mock.patch.object(multiprocessing_utils,
                                          'GetProcessPool')
   self._pool_mock = self._pool_patcher.start()
   self._pool_mock.return_value = unittest_utils.FakePool()
   self.addCleanup(self._pool_patcher.stop)
Esempio n. 2
0
 def setUp(self):
   self._get_patcher = mock.patch.object(builders,
                                         '_GetMirroredBuildersForCiBuilder')
   self._get_mock = self._get_patcher.start()
   self.addCleanup(self._get_patcher.stop)
   self._pool_patcher = mock.patch.object(multiprocessing_utils,
                                          'GetProcessPool')
   self._pool_mock = self._pool_patcher.start()
   self._pool_mock.return_value = unittest_utils.FakePool()
   self.addCleanup(self._pool_patcher.stop)
Esempio n. 3
0
 def setUp(self):
   self._patcher = mock.patch.object(queries, 'QueryBuilder')
   self._query_mock = self._patcher.start()
   self.addCleanup(self._patcher.stop)
   self._pool_patcher = mock.patch.object(multiprocessing_utils,
                                          'GetProcessPool')
   self._pool_mock = self._pool_patcher.start()
   self._pool_mock.return_value = unittest_utils.FakePool()
   self.addCleanup(self._pool_patcher.stop)
   self._sleep_patcher = mock.patch.object(queries,
                                           'ASYNC_RESULT_SLEEP_DURATION',
                                           return_value=0.1)
   self._sleep_mock = self._sleep_patcher.start()
   self.addCleanup(self._sleep_patcher.stop)