Exemplo n.º 1
0
 def setUp(self):
     super(TestBotBase, self).setUp()
     # Throw away all swarming environ if running the test on Swarming. It may
     # interfere with the test.
     for k in os.environ.keys():
         if k.startswith('SWARMING_'):
             os.environ.pop(k)
     self.root_dir = tempfile.mkdtemp(prefix='bot_main')
     self.old_cwd = os.getcwd()
     os.chdir(self.root_dir)
     self.url = 'https://localhost:1'
     self.attributes = {
         'dimensions': {
             'foo': ['bar'],
             'id': ['localhost'],
             'pool': ['default'],
         },
         'state': {
             'bot_group_cfg_version': None,
             'cost_usd_hour': 3600.,
             'sleep_streak': 0,
         },
         'version': '123',
     }
     self.bot = self.make_bot()
     tools.clear_cache_all()
Exemplo n.º 2
0
 def setUp(self):
     super(TestCase, self).setUp()
     tools.clear_cache_all()
     self._tmpdir = tempfile.mkdtemp(prefix='swarming_main')
     self._zip_file = os.path.join(self._tmpdir, 'swarming_bot.zip')
     code, _ = swarmingserver_bot_fake.gen_zip(self.url)
     with open(self._zip_file, 'wb') as f:
         f.write(code)
Exemplo n.º 3
0
 def tearDown(self):
     super(TestOsx, self).tearDown()
     mock.patch.stopall()
     tools.clear_cache_all()
Exemplo n.º 4
0
 def setUp(self):
     super(TestOsx, self).setUp()
     tools.clear_cache_all()
     self.mock_check_output = mock.patch('subprocess.check_output').start()
     self.mock_listdir = mock.patch('os.listdir').start()
     self.mock_path_exists = mock.patch('os.path.exists').start()
Exemplo n.º 5
0
 def tearDown(self):
     super(TestOsUtilities, self).tearDown()
     tools.clear_cache_all()
Exemplo n.º 6
0
 def setUp(self):
     super(TestOsUtilities, self).setUp()
     tools.clear_cache_all()
Exemplo n.º 7
0
 def setUp(self):
   super(TestLinux, self).setUp()
   tools.clear_cache_all()
   self.mock_check_output = mock.patch('subprocess.check_output').start()
Exemplo n.º 8
0
 def tearDown(self):
   super(TestDocker, self).tearDown()
   tools.clear_cache_all()
Exemplo n.º 9
0
 def setUp(self):
   super(TestDocker, self).setUp()
   tools.clear_cache_all()
Exemplo n.º 10
0
 def tearDown(self):
   super(TestCPUInfo, self).tearDown()
   tools.clear_cache_all()
Exemplo n.º 11
0
 def setUp(self):
   super(TestCPUInfo, self).setUp()
   tools.clear_cache_all()