def create_config(self, coord_address): host_config = self[coord_address.host] process_config = host_config[coord_address.process] component_config = process_config[coord_address.component] config = ConfigurationManager() self._update_config(config, self) self._update_config(config, host_config) self._update_config(config, process_config) self._update_config(config, component_config) config.append_value('deployment_dir', self.deployment_dir) return config
def setUp(self): # Initialize the experiment for testing. # We set the archimedes_real_device setting to False so that # it doesn't attempt to contact the real ip. self.cfg_manager = ConfigurationManager() self.cfg_manager._set_value("archimedes_real_device", False) self.cfg_manager._set_value("archimedes_instances", { "default": "http://localhost:8000", "second": "http://localhost:8001" }) self.experiment = Archimedes(None, None, self.cfg_manager) self.lab_session_id = SessionId('my-session-id')
def setUp(self): self.cfg_manager = ConfigurationManager() self.cfg_manager.append_module(configuration_module) self.cfg_manager._set_value(configuration_doc.FACADE_TIMEOUT, 0.001) self.current_port = new_port() self.cfg_manager._set_value(configuration_doc.CORE_FACADE_PORT, self.current_port) app = HelloWorldApp() self.server = wsgi_manager.WebLabWsgiServer(self.cfg_manager, application=app)
def test_unknown_instance(self): """ Check that it replies an error if the instance isn't in the config. """ self.cfg_manager = ConfigurationManager() self.cfg_manager._set_value("archimedes_instances", { "first": "http://localhost:8000", "second": "http://localhost:8001" }) self.experiment = Archimedes(None, None, self.cfg_manager) start = self.experiment.do_start_experiment("{}", "{}") up_resp = self.experiment.do_send_command_to_device("UP") assert up_resp.startswith("ERROR:") up_resp = self.experiment.do_send_command_to_device("default:UP") assert up_resp.startswith("ERROR:")
def setUp(self): cfg_manager = ConfigurationManager() cfg_manager.append_module(configuration_module) self.jtag_blazer = jtag_blazer.JTagBlazer(cfg_manager)
first_pump = 10 else: first_pump = 0 if second_pump: second_pump = 10 else: second_pump = 0 self._watertank.set_input(0, first_pump) self._watertank.set_input(1, second_pump) if __name__ == "__main__": from voodoo.configuration import ConfigurationManager from voodoo.sessions.session_id import SessionId cfg_manager = ConfigurationManager() try: cfg_manager.append_path( "../../../launch/sample/main_machine/main_instance/experiment_fpga/server_config.py" ) except: cfg_manager.append_path( "../launch/sample/main_machine/main_instance/experiment_fpga/server_config.py" ) experiment = ElevatorExperiment(None, None, cfg_manager) lab_session_id = SessionId('my-session-id') experiment.do_start_experiment() experiment._max_use_time = 10
def setUp(self): cfg_manager = ConfigurationManager() cfg_manager.append_module(configuration_module) self.device = digilent_adept.DigilentAdept(cfg_manager)