def populate_initial_data(dm: Dimensigon): from dimensigon.domain.entities import ActionTemplate, Locker, Server, User, Parameter with session_scope(session=dm.get_session()) as session: gates = dm.config.http_conf.get('binds', None) SchemaChanges.set_initial(session) dm.server_id = Server.set_initial(session, gates) Locker.set_initial(session, unlock=True) ActionTemplate.set_initial(session) User.set_initial(session) Parameter.set_initial(session)
def setUp(self): """Create and configure a new app instance for each test.""" # create the app with common test config self.app = create_app('test') self.app_context = self.app.app_context() self.app_context.push() self.client = self.app.test_client() self.auth = HTTPBearerAuth( create_access_token('00000000-0000-0000-0000-000000000001')) db.create_all() self.at = ActionTemplate(name='action', version=1, action_type=ActionType.SHELL, code='code to run', expected_stdout='expected output', expected_rc=0, system_kwargs={}) ActionTemplate.set_initial()