def post(self, key): if len(self.get_arguments('action')) > 0: # action try: entity = self.registry.get_resource(key) action = self.parse_action() workflow.action_entity(entity, action, self.registry) self.render_entity(entity) except AttributeError as attr: raise HTTPError(400, str(attr)) except KeyError as key: raise HTTPError(404, str(key)) else: # update try: old = self.registry.get_resource(key) new = self.parse_entity(def_kind=old.kind) workflow.update_entity(old, new, self.registry) self.render_entity(old) except AttributeError as attr: raise HTTPError(400, str(attr)) except KeyError as key: raise HTTPError(404, str(key))
def test_update_entity_for_success(self): ''' Test replace... ''' # not much to verify here - just calls backends... workflow.update_entity(self.src_entity, self.trg_entity, self.registry)