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()
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)
def tearDown(self): super(TestOsx, self).tearDown() mock.patch.stopall() tools.clear_cache_all()
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()
def tearDown(self): super(TestOsUtilities, self).tearDown() tools.clear_cache_all()
def setUp(self): super(TestOsUtilities, self).setUp() tools.clear_cache_all()
def setUp(self): super(TestLinux, self).setUp() tools.clear_cache_all() self.mock_check_output = mock.patch('subprocess.check_output').start()
def tearDown(self): super(TestDocker, self).tearDown() tools.clear_cache_all()
def setUp(self): super(TestDocker, self).setUp() tools.clear_cache_all()
def tearDown(self): super(TestCPUInfo, self).tearDown() tools.clear_cache_all()
def setUp(self): super(TestCPUInfo, self).setUp() tools.clear_cache_all()