def __init__(self, template, file_path): self.navigator = Navigator() self.template = template self.file_path = file_path self.template_data = read_xml_get_json(template, ordered_dict=True) self.data = read_xml_get_json(file_path, ordered_dict=True) self.output = {"status": True, "message": ""} self.root = "Project"
def __init__(self, template, file_path): """ Constructor of the VerifyCaseFile class """ self.navigator = Navigator() self.template = template self.file_path = file_path self.template_data = read_xml_get_json(template, ordered_dict=True) self.data = read_xml_get_json(file_path, ordered_dict=True) self.output = {"status": True, "message": ""} self.root = "TestWrapper" self.major = ("Details", "Requirements", "Steps")
def prerequisites_handler(self, request): ref_file = join_path(self.static_dir, "base_templates", "empty.xml") prereqs = read_xml_get_json(ref_file)["data"]["warhorn"]["dependency"] prereq_data = [] for prereq in prereqs: temp = {} for key, value in list(prereq.items()): temp[key.strip('@')] = value temp["status"] = "install" try: module_name = __import__(temp["name"]) some_var = module_name.__version__ except ImportError: temp["available_version"] = "--" temp["installBtnText"] = "Install" except Exception as e: print( "-- An Exception Occurred -- while getting details about {0}: {1}" .format(temp["name"], e)) temp["available_version"] = "--" temp["installBtnText"] = "Install" else: temp["available_version"] = some_var if LooseVersion(str(temp["version"])) <= LooseVersion( str(temp["available_version"])): temp["installBtnText"] = "Installed" temp["status"] = "installed" else: temp["installBtnText"] = "Upgrade" temp["status"] = "upgrade" prereq_data.append(copy.deepcopy(temp)) return prereq_data
def __init__(self, data_file, ref_data_file): self.data_file = data_file self.data = read_xml_get_json(data_file) self.ref_data_file = ref_data_file self.nav_obj = Navigator() self.dependency_template = join_path(self.nav_obj.get_katana_dir(), "native", "settings", "static", "settings", "base_templates", "empty.xml") self.ref_data = self._get_ref_data() self.dependency_dict = self.__get_dependency_dict()
def __init__(self, filepath, base_filepath): self.filepath = filepath self.base_filepath = base_filepath self.json_data = read_xml_get_json(self.filepath) self.defaults = read_xml_get_json(self.base_filepath)
def _get_ref_data(self): data = read_xml_get_json(self.ref_data_file) dependency_data = read_xml_get_json(self.dependency_template) data["data"]["warhorn"] = copy.deepcopy( dependency_data["data"]["warhorn"]) return data