def independent_action(): action = Action(action_type=ActionType.SAMPLE_CREATION, name='Example Action', schema={ 'title': 'Example Object', 'type': 'object', 'properties': {} }, description='', instrument_id=None) sampledb.db.session.add(action) sampledb.db.session.commit() # force attribute refresh assert action.id is not None return action
def instrument_action(instrument): action = Action(action_type_id=sampledb.models.ActionType.SAMPLE_CREATION, name='Example Action', schema={ 'title': 'Example Action', 'type': 'action', 'properties': {} }, description='', instrument_id=instrument.id) sampledb.db.session.add(action) sampledb.db.session.commit() # force attribute refresh assert action.id is not None return action
def instrument_action(instrument): action = Action(action_type=ActionType.SAMPLE_CREATION, name='Example Action', schema={ 'title': 'Example Object', 'type': 'object', 'properties': { 'name': { 'title': 'Name', 'type': 'text' } }, 'required': ['name'] }, description='', instrument_id=instrument.id) sampledb.db.session.add(action) sampledb.db.session.commit() # force attribute refresh assert action.id is not None return action