# --------------------------------------------------------------------------------------------------------- # Author : Ulrich Carmesin # Source : gitea.ucarmesin.de # --------------------------------------------------------------------------------------------------------- import basic.constants as B import model.entity import tools.path_const as P import tools.data_const as D import tools.config_tool import tools.file_tool import tools.git_tool TABLE_NAME = "story" """ system-name for this entity """ FIELD_ID = "stid" FIELD_NAME = "name" FIELD_DESCRIPTION = B.SUBJECT_DESCRIPTION FIELD_REFERENCE = B.SUBJECT_REFERENCE FIELD_PROJECT = B.SUBJECT_PROJECT FIELD_ATTRIBUTES = B.NODE_ATTRIBUTES LIST_FIELDS = [FIELD_ID, FIELD_NAME, FIELD_DESCRIPTION, FIELD_REFERENCE, FIELD_PROJECT, FIELD_ATTRIBUTES] """ list of object-attributes """ LIST_SUBTABLES = [] FILE_EXTENSION = D.DFILE_TYPE_CSV UNIQUE_FIELDS = [FIELD_NAME] """ unique business field as human identifer """ IDENTIFYER_FIELDS = [FIELD_ID] """ unique technical field as technical identifer """ class Story(model.entity.Entity): stid = 0 story = "" project = "" description = "" reference = "" def __init__(self, job, project, name=""): """ to be initialized by readSpec :param job: """ self.job = job self.project = project def read_unique_names(self, job, project, application, gran, args): """ reads the entity-names from file-storage :param job: :param opt. project: select-criteria if used and defined :param opt. application: select-criteria if used and defined :param opt. gran: granularity values testcase / testsuite / testplan :param opt. args additional args :return: list of entity-names """ config = self.getConfig(job, P.KEY_CATALOG, B.SUBJECT_STORIES, tools.config_tool.get_plain_filename(job, "")) outList = list(config[B.SUBJECT_STORIES][B.DATA_NODE_KEYS].keys()) return outList def read_entity(self, job, name): """ reads the entity from the file-system :param job: :param name: :return: """ config = self.getConfig(job, P.KEY_CATALOG, B.SUBJECT_STORIES, tools.config_tool.get_plain_filename(job, name)) return self.setAttributes(config, name, LIST_FIELDS, LIST_SUBTABLES)