def setUp(self): self.god = mock.mock_god() self.god.stub_with(drones, 'AUTOTEST_INSTALL_DIR', self._DRONE_INSTALL_DIR) self.manager = drone_manager.DroneManager() self.god.stub_with(self.manager, '_results_dir', self._RESULTS_DIR) # we don't want this to ever actually get called self.god.stub_function(drones, 'get_drone') # we don't want the DroneManager to go messing with global config def do_nothing(): pass self.god.stub_with(self.manager, 'refresh_drone_configs', do_nothing) self.results_drone = MockDrone('results_drone', 0, 10) self.manager._results_drone = self.results_drone self.drone_utility_path = 'mock-drone-utility-path' self.mock_return = {'results': ['mock results'], 'warnings': []}
def setUp(self): self.god = mock.mock_god() self.god.stub_with(drones, 'AUTOTEST_INSTALL_DIR', self._DRONE_INSTALL_DIR) self.manager = drone_manager.DroneManager() self.god.stub_with(self.manager, '_results_dir', self._RESULTS_DIR) # we don't want this to ever actually get called self.god.stub_function(drones, 'get_drone') # we don't want the DroneManager to go messing with global config def do_nothing(): pass self.god.stub_with(self.manager, 'refresh_drone_configs', do_nothing) # set up some dummy drones self.mock_drone = MockDrone('mock_drone') self.manager._drones[self.mock_drone.name] = self.mock_drone self.results_drone = MockDrone('results_drone', 0, 10) self.manager._results_drone = self.results_drone self.mock_drone_process = drone_manager.Process(self.mock_drone.name, 0)