def store_burst(project_id, simulator_config=None): """ Build and persist BurstConfiguration entity. """ burst = BurstConfiguration(project_id) if simulator_config is not None: burst.simulator_configuration = simulator_config burst.prepare_before_save() return dao.store_entity(burst)
def transactional_setup_method(self): _, self.connectivity = DatatypesFactory().create_connectivity() self.test_user = TestFactory.create_user(username="******") self.test_project = TestFactory.create_project(self.test_user, "Test") burst_conf = BurstConfiguration(self.test_project.id) burst_conf._simulator_configuration = self.CONF_HOPFIELD_HEUN_STOCH_RANGES burst_conf.prepare_after_load() burst_conf.simulator_configuration['connectivity'] = {'value': self.connectivity.gid} self.s_manager = SerializationManager(burst_conf) self.empty_manager = SerializationManager(BurstConfiguration(None))
def setUp(self): _, self.connectivity = DatatypesFactory().create_connectivity() self.test_user = TestFactory.create_user(username="******") self.test_project = TestFactory.create_project(self.test_user, "Test") burst_conf = BurstConfiguration(self.test_project.id) burst_conf._simulator_configuration = self.CONF_HOPFIELD_HEUN_STOCH_RANGES burst_conf.prepare_after_load() burst_conf.simulator_configuration['connectivity'] = {'value': self.connectivity.gid} self.s_manager = SerializationManager(burst_conf) self.empty_manager = SerializationManager(BurstConfiguration(None))