diff --git a/JsonPreprocessor/CJsonPreprocessor.py b/JsonPreprocessor/CJsonPreprocessor.py index dbf5d6ad..d5cae2e6 100644 --- a/JsonPreprocessor/CJsonPreprocessor.py +++ b/JsonPreprocessor/CJsonPreprocessor.py @@ -66,6 +66,7 @@ class CNameMangling(Enum): DUPLICATEDKEY_00 = "__rootDuplicatedKey__" DUPLICATEDKEY_01 = "__handleDuplicatedKey__" DUPLICATEDKEY_02 = "__RecursiveInitialValue__" + STRINGCONVERT = "__ConvertParameterToString__" class CPythonJSONDecoder(json.JSONDecoder): """ @@ -366,7 +367,7 @@ def __referVarHandle(referVar : str, sInputStr : str) -> str: sInputStr = re.sub('\$\${\s*([^\}]*)\s*}', sParam, sInputStr) referVar = re.findall('(\$\${\s*.*?\s*})', sInputStr)[0] tmpReferVar = re.sub("\$", "\\$", referVar) - pattern = '(' + tmpReferVar + '\s*\[\s*.*?\s*\])' + pattern = '(' + tmpReferVar + '\s*\[+\s*.*?\s*\]+)' variable = re.findall(pattern, sInputStr) if variable == []: return referVar @@ -382,6 +383,39 @@ def __referVarHandle(referVar : str, sInputStr : str) -> str: pattern = "\$\${\s*[0-9A-Za-z_]+[0-9A-Za-z\.\-_]*\s*}" referVars = re.findall("(" + pattern + ")", sInputStr) + while sInputStr.count("$$") > len(referVars): + for var in referVars: + if "." in var: + ddVar = re.sub('\$\${\s*(.*?)\s*}', '\\1', var) + lddVar = ddVar.split(".") + lElements = self.__handleDotdictFormat(lddVar, []) + sVar = '$${' + lElements[0] + '}' + lElements.pop(0) + for item in lElements: + sVar = sVar + "[" + item + "]" if re.match("^\d+$", item) else sVar + "['" + item + "']" + sInputStr = sInputStr.replace(var, sVar) + else: + sVar = var + rootVar = re.search('^\s*\$\${(\s*.*?)}', sVar).group(1) + tmpVar = re.sub("\$", "\\$", sVar) + tmpVar = re.sub("((\[\s*'[^\$\[\]\(\)]+'\s*\]|\[\s*\d+\s*\])*)", "", tmpVar) + subPattern = tmpVar + "((\[\s*'[^\$\[\]\(\)]+'\s*\]|\[\s*\d+\s*\])*)" + subVar = re.search(subPattern, sInputStr).group(1) + sExec = "value = " + rootVar + subVar + try: + ldict = {} + exec(sExec, globals(), ldict) + tmpValue = ldict['value'] + except: + raise Exception(f"The variable '{var.replace('$$', '$')}' is not available!") + subPattern = "(" + tmpVar + "(\[\s*'[^\$\[\]\(\)]+'\s*\]|\[\s*\d+\s*\])*)" + var = re.sub("\$", "\\$", re.search(subPattern, sInputStr).group(1)) + if re.search("\[.+\]", var): + var = var.replace("[", "\[") + var = var.replace("]", "\]") + sInputStr = re.sub(var, tmpValue, sInputStr) if isinstance(tmpValue, str) else \ + re.sub(var, str(tmpValue), sInputStr) + referVars = re.findall("(" + pattern + ")", sInputStr) lNestedParam = [] if len(referVars) > 1: if not bKey: @@ -427,7 +461,7 @@ def __referVarHandle(referVar : str, sInputStr : str) -> str: sInputStr = re.sub(pattern, '\'' + tmpValue + '\'', sInputStr) if isinstance(tmpValue, str) else \ re.sub(pattern, '\'' + str(tmpValue) + '\'', sInputStr) sKeyHandled = sUpdateVar + sInputStr - lNestedParam.append(re.sub("\$\$", "$", sKeyHandled)) + lNestedParam.append(re.sub("\$\$", "$", __referVarHandle(sUpdateVar, sKeyHandled))) return lNestedParam else: lNestedParam.append(re.sub("\$\$", "$", __referVarHandle(referVars[0], sInputStr))) @@ -542,10 +576,6 @@ def __jsonUpdated(k, v, oJson, bNested, keyNested = ''): else: if CNameMangling.AVOIDDATATYPE.value in k: k = re.sub(CNameMangling.AVOIDDATATYPE.value, "", k) - elif re.search("[\[\]\(\)\s{}]", k): - errorMsg = f"Setting value '{v}' for parameter '{k}' is not permissible \ -when substituting parameters of composite data types in dictionary key names!" - raise Exception(errorMsg) oJson[k] = v globals().update({k:v}) @@ -556,8 +586,16 @@ def __jsonUpdated(k, v, oJson, bNested, keyNested = ''): oJson[k] = v globals().update({k:v}) - def __loadNestedValue(initValue: str, sInputStr: str): + def __loadNestedValue(initValue: str, sInputStr: str, bKey=False, key=''): + varPattern = "\${\s*[0-9A-Za-z_]+[0-9A-Za-z\.\-_]*\s*}" + dictPattern = "(\[+\s*'[^\$\[\]\(\)]+'\s*\]+|\[+\s*\d+\s*\]+|\[+\s*" + varPattern + ".*\]+)*" + pattern = varPattern + dictPattern bStringValue = False + bValueConvertString = False + if CNameMangling.STRINGCONVERT.value in sInputStr: + bValueConvertString = True + sInputStr = sInputStr.replace(CNameMangling.STRINGCONVERT.value, '') + initValue = initValue.replace(CNameMangling.STRINGCONVERT.value, '') if re.search("(str\(\s*" + pattern + "\))", sInputStr.lower()): sInputStr = re.sub("str\(\s*(" + pattern + ")\s*\)", "$\\1", sInputStr) bStringValue = True @@ -578,13 +616,27 @@ def __loadNestedValue(initValue: str, sInputStr: str): ldict = {} exec(sExec, globals(), ldict) if bStringValue: + pattern = "\${\s*[0-9A-Za-z_]+[0-9A-Za-z\.\-_]*\s*}(\[+\s*'[^\$]+'\s*\]+|\[+\s*\d+\s*\]+)*" sInputStr = re.sub("(\$" + pattern + ")", str(ldict['value']), sInputStr, count=1) else: sInputStr = re.sub("\$\$", "$", sInputStr) - sInputStr = ldict['value'] + sInputStr = str(ldict['value']) if bValueConvertString else ldict['value'] except: self.__reset() + if CNameMangling.DUPLICATEDKEY_00.value in valueProcessed: + valueProcessed = valueProcessed.replace(CNameMangling.DUPLICATEDKEY_00.value, '') + elif CNameMangling.DUPLICATEDKEY_02.value in valueProcessed: + valueProcessed = valueProcessed.replace(CNameMangling.DUPLICATEDKEY_02.value, '') raise Exception(f"The variable '{valueProcessed}' is not available!") + if bKey and type(ldict['value']) in [list, dict]: + self.__reset() + while 'str(' in key: + key = re.sub("str\(([0-9A-Za-z\._\${}'\[\]]+)\)", "\\1", key) + errorMsg = f"Could not substitute parameter '{key}'! Composite data types are not allowed. \ +The value of parameter '{valueProcessed}' is {ldict['value']}" + raise Exception(errorMsg) + if "${" not in str(sInputStr): + break return sInputStr if bool(self.currentCfg) and not recursive: @@ -594,7 +646,7 @@ def __loadNestedValue(initValue: str, sInputStr: str): globals().update({k:v}) tmpJson = copy.deepcopy(oJson) - pattern = "\${\s*[0-9A-Za-z_]+[0-9A-Za-z\.\-_]*\s*}(\[+\s*'.+'\s*\]+|\[+\s*\d+\s*\]+)*" + pattern = "\${\s*[0-9A-Za-z_]+[0-9A-Za-z\.\$\{\}\-_]*\s*}(\[+\s*'.+'\s*\]+|\[+\s*\d+\s*\]+)*" for k, v in tmpJson.items(): keyNested = '' if CNameMangling.DUPLICATEDKEY_00.value in k: @@ -602,6 +654,14 @@ def __loadNestedValue(initValue: str, sInputStr: str): k = k.replace(CNameMangling.DUPLICATEDKEY_00.value, '') oJson[k] = v if re.search("(str\(" + pattern + "\))", k.lower()): + keyNested = k + bNested = True + while "${" in k: + k = __loadNestedValue(keyNested, k, bKey=True, key=keyNested) + elif CNameMangling.STRINGCONVERT.value in k: + del oJson[k] + k = k.replace(CNameMangling.STRINGCONVERT.value, '') + oJson[k] = v keyNested = k bNested = True while "${" in k: @@ -659,7 +719,7 @@ def __loadNestedValue(initValue: str, sInputStr: str): del tmpJson return oJson, bNested - def __checkAndUpdateKeyValue(self, sInputStr: str) -> str: + def __checkAndUpdateKeyValue(self, sInputStr: str, nestedKey = False) -> str: ''' This function checks and makes up all nested parameters in json configuration files. @@ -695,24 +755,46 @@ def __recursiveNestedHandling(sInputStr: str, lNestedParam: list) -> str: return sInputStr variablePattern = "[0-9A-Za-z_]+[0-9A-Za-z\.\-_]*" - dictPattern = "\[+\s*'.+'\s*\]+|\[+\s*\d+\s*\]+|\[+\s*\${\s*" + variablePattern + "\s*}\s*\]+" + dictPattern = "\[+\s*'.+'\s*\]+|\[+\s*\d+\s*\]+|\[+\s*\${\s*" + variablePattern + "\s*}.*\]+" nestedPattern = "\${\s*" + variablePattern + "(\${\s*" + variablePattern + "\s*})*" + "\s*}(" + dictPattern +")*" valueStrPattern = "[\"|\']\s*[0-9A-Za-z_\-\s*]+[\"|\']" valueNumberPattern = "[0-9\.]+" if "${" in sInputStr: - if re.match("\s*{*\[*\".+\"\s*", sInputStr.lower()) and sInputStr.count("\"")==2 \ + if re.match("^\s*" + nestedPattern + "\s*,*\]*}*\s*$", sInputStr.lower()): + dictPattern = "\[+\s*'.+'\s*\]+|\[+\s*\d+\s*\]+|\[+\s*\${\s*" + variablePattern + "\s*}.*\]+" + nestedPattern = "\${\s*" + variablePattern + "(\${\s*" + variablePattern + "\s*})*" + "\s*}(" + dictPattern +")*" + sInputStr = re.sub("(" + nestedPattern + ")", "\"\\1\"", sInputStr) + nestedParam = re.sub("^\s*\"(.+)\"\s*.*$", "\\1", sInputStr) + self.lNestedParams.append(nestedParam) + elif re.match("^\s*\"\s*" + nestedPattern + "\"\s*,*\]*}*\s*$", sInputStr.lower()): + nestedParam = re.sub("^\s*\"(.+)\"\s*.*$", "\\1", sInputStr) + self.lNestedParams.append(nestedParam) + sInputStr = sInputStr.replace(nestedParam, nestedParam + CNameMangling.STRINGCONVERT.value) + elif re.match("\s*{*\[*\".+\"\s*", sInputStr.lower()) and sInputStr.count("\"")==2 \ and re.search("(" + nestedPattern + ")*", sInputStr.lower()): - lNestedParam = re.findall("(" + nestedPattern + ")", sInputStr) + dictPattern = "\[+\s*'[0-9A-Za-z\.\-_${}\[\]]*'\s*\]+|\[+\s*\d+\s*\]+|\[+\s*\${\s*" + variablePattern + "\s*}\s*\]+" + nestedPattern = "\${\s*" + variablePattern + "(\${\s*" + variablePattern + "\s*})*" + "\s*}(" + dictPattern +")*" + lNestedParam = [] + for item in re.findall("(" + nestedPattern + ")", sInputStr): + if item[0] not in lNestedParam: + lNestedParam.append(item[0]) lNestedBase = [] tmpList = [] for nestedParam in lNestedParam: - if nestedParam[0].count("${") > 1: - tmpNested = nestedParam[0] + if nestedParam.count("${") > 1: + tmpNested = nestedParam if "[" in tmpNested: - pattern = "\[\s*(\${\s*" + variablePattern + "\s*})\s*\]" + pattern = "\[\s*'*\s*(\${\s*[0-9A-Za-z\.\-_${}\[\]]*\s*})\s*'*\s*\]" lNestedBase.append(re.findall(pattern, tmpNested)[0]) for item in re.findall(pattern, tmpNested): + tmpItem = item + while tmpItem.count("${") > 1: + newItem = re.sub("(\${\s*" + variablePattern + "\s*})", "str(\\1)", item) + tmpNested = tmpNested.replace(item, newItem) + item = newItem + tmpItem = re.sub("(str\(.+\))", "", item) + sInputStr = sInputStr.replace(nestedParam, tmpNested) patternItem = re.sub(r'([$()\[\]])', r'\\\1', item) tmpNested = re.sub("(" + patternItem + ")", "str(\\1)", tmpNested) sInputStr = re.sub("(" + patternItem + ")", "str(\\1)", sInputStr) @@ -730,21 +812,19 @@ def __recursiveNestedHandling(sInputStr: str, lNestedParam: list) -> str: sInputStr = re.sub("(" + pattern + ")", "str(\\1)", sInputStr) tmpList.append("str(" + tmpNested + ")") else: - tmpList.append("str(" + nestedParam[0] + ")") - nestedBasePattern = re.sub(r'([$()\[\]])', r'\\\1', nestedParam[0]) + tmpList.append("str(" + nestedParam + ")") + nestedBasePattern = re.sub(r'([$()\[\]])', r'\\\1', nestedParam) + nestedBasePattern = nestedBasePattern.replace("{", "\{") + nestedBasePattern = nestedBasePattern.replace("}", "\}") sInputStr = re.sub("(" + nestedBasePattern + ")", "str(\\1)", sInputStr) - lNestedBase.append(nestedParam[0]) + lNestedBase.append(nestedParam) for nestedBase in lNestedBase: self.lNestedParams.append(nestedBase) sInputStr = __recursiveNestedHandling(sInputStr, tmpList) - elif re.match("^\s*" + nestedPattern + "\s*,*\]*}*\s*$", sInputStr.lower()): - sInputStr = re.sub("(" + nestedPattern + ")", "\"\\1\"", sInputStr) - nestedParam = re.sub("^\s*\"(.+)\"\s*.*$", "\\1", sInputStr) - self.lNestedParams.append(nestedParam) - elif re.search("(" + nestedPattern + ")*", sInputStr.lower()) and sInputStr.count("${")>1: - raise Exception(f"Invalid nested parameter format: {sInputStr} - The double quotes are missing!!!") elif "," in sInputStr: + if not re.match("^\s*\".+\"\s*$", sInputStr): + raise Exception(f"Invalid nested parameter format: {sInputStr} - The double quotes are missing!!!") listPattern = "^\s*(\"*" + nestedPattern + "\"*\s*,+\s*|" + valueStrPattern + "\s*,+\s*|" + valueNumberPattern + "\s*,+\s*)+" + \ "(\"*" + nestedPattern + "\"*\s*,*\s*|" + valueStrPattern + "\s*,*\s*|" + valueNumberPattern + "\s*,*\s*)*\]*}*\s*$" lNestedParam = re.findall("(" + nestedPattern + ")", sInputStr) @@ -770,8 +850,13 @@ def __recursiveNestedHandling(sInputStr: str, lNestedParam: list) -> str: self.lNestedParams.append(nestedParam) newInputStr = newInputStr + item if tmpItem==items[len(items)-1] else newInputStr + item + "," sInputStr = newInputStr + elif re.search("\${\s*}", sInputStr) or re.search("\${.+}\.", sInputStr) \ + or (nestedKey and (sInputStr.count("{") != sInputStr.count("}") or sInputStr.count("[") != sInputStr.count("]"))): + raise Exception(f"Invalid parameter format: {sInputStr}") + elif nestedKey and re.match("^\s*\${[^\(\)\!@#%\^\&\-\+\/\\\=`~\?]+[}\[\]]+\s*$", sInputStr): + sInputStr = re.sub("^\s*(\${[^\(\)\!@#%\^\&\-\+\/\\\=`~\?]+[}\[\]]+)\s*$", "\"\\1\"", sInputStr) else: - raise Exception(f"Invalid nested parameter format: {sInputStr}") + raise Exception(f"Invalid nested parameter format: {sInputStr} - The double quotes are missing!!!") sOutput = sInputStr return sOutput @@ -827,6 +912,7 @@ def __handleListElements(sInput : str) -> str: return newItem def __handleDuplicatedKey(dInput : dict) -> dict: + pattern = "\${\s*[0-9A-Za-z_]+[0-9A-Za-z\.\-_]*\s*}(\[+\s*'[0-9A-Za-z\._]+'\s*\]+|\[+\s*\d+\s*\]+)*" tmpDict = copy.deepcopy(dInput) for k, v in tmpDict.items(): if isinstance(v, list) and v[0]==CNameMangling.DUPLICATEDKEY_01.value: @@ -892,7 +978,7 @@ def __removeDuplicatedKey(dInput : dict) -> dict: for item in dInput: __removeDuplicatedKey(item) - jFile = CString.NormalizePath(jFile, sReferencePathAbs=os.path.dirname(sys.argv[0])) + jFile = CString.NormalizePath(jFile, sReferencePathAbs=os.path.dirname(os.path.abspath(sys.argv[0]))) if not(os.path.isfile(jFile)): raise Exception(f"File '{jFile}' is not existing!") @@ -916,12 +1002,20 @@ def __removeDuplicatedKey(dInput : dict) -> dict: raise Exception(f"\n{str(error)} in line: '{line}'") if re.search(pattern, line): + lNestedVar = re.findall("\${\s*([0-9A-Za-z_]+[0-9A-Za-z\.\-_]*)\s*}", line) + for nestedVar in lNestedVar: + if nestedVar[0].isdigit(): + raise Exception(f"Invalid parameter format in line: {line.strip()}") tmpList = re.findall("(\"[^\"]+\")", line) line = re.sub("(\"[^\"]+\")", CNameMangling.COLONS.value, line) items = re.split("\s*:\s*", line) newLine = "" i=0 for item in items: + nestedKey = False + nestedKeyPattern = "^\s*,\s*\${.+[\]}]\s*$" + if i==0 or re.match(nestedKeyPattern, item): + nestedKey = True if CNameMangling.COLONS.value in item: while CNameMangling.COLONS.value in item: item = re.sub(CNameMangling.COLONS.value, tmpList[0], item, count=1) @@ -951,7 +1045,7 @@ def __removeDuplicatedKey(dInput : dict) -> dict: newSubItem = __handleListElements(item) newSubItem = newSubItem + "]" if bLastElement else newSubItem + "]," else: - newSubItem = self.__checkAndUpdateKeyValue(item) + newSubItem = self.__checkAndUpdateKeyValue(item, nestedKey) if i dict: sJsonDataUpdated = sJsonDataUpdated + newLine + "\n" else: if "${" in line: - raise Exception(f"Invalid parameter format in line: {line.strip()}") + invalidPattern1 = "\${\s*[0-9A-Za-z\._]*\[.+\][0-9A-Za-z\._]*\s*}" + if re.search(invalidPattern1, line): + raise Exception(f"Invalid syntax: Found index inside curly brackets in line '{line.strip()}'. \ +Indices in square brackets have to be placed outside the curly brackets.") + else: + raise Exception(f"Invalid parameter format in line: {line.strip()}") sJsonDataUpdated = sJsonDataUpdated + line + "\n" CJSONDecoder = None @@ -1036,3 +1135,35 @@ def __removeDuplicatedKey(dInput : dict) -> dict: self.__reset() __removeDuplicatedKey(oJson) return oJson + + def jsonDump(self, oJson : dict, outFile : str) -> str: + ''' + This function writes the content of a Python dictionary to a file in JSON format and returns a normalized path to this JSON file. + +**Args:** + + **oJson** (*dictionary*) + + Json/Dictionary object. + + **outFile** (*string*) + + Path and name of the JSON output file. The path can be absolute or relative and is also allowed to contain environment variables. + +**Returns:** + + **outFile** (*string*) + + Normalized path and name of the JSON output file. + ''' + + outFile = CString.NormalizePath(outFile, sReferencePathAbs=os.path.dirname(os.path.abspath(sys.argv[0]))) + jsonObject = json.dumps(oJson, ensure_ascii=False, indent=4) + try: + with open(outFile, "w", encoding='utf-8') as f: + f.write(jsonObject) + except Exception as error: + errorMsg = f"Could not write a JSON file '{outFile}'! Reason: {error}" + raise Exception(errorMsg) + + return outFile \ No newline at end of file diff --git a/JsonPreprocessor/JsonPreprocessor.pdf b/JsonPreprocessor/JsonPreprocessor.pdf index 0b5f8b4a..7b2544f2 100644 Binary files a/JsonPreprocessor/JsonPreprocessor.pdf and b/JsonPreprocessor/JsonPreprocessor.pdf differ diff --git a/JsonPreprocessor/version.py b/JsonPreprocessor/version.py index 63175f97..f8d552e5 100644 --- a/JsonPreprocessor/version.py +++ b/JsonPreprocessor/version.py @@ -18,6 +18,6 @@ # # Version and date of JsonPreprocessor # -VERSION = "0.3.0" -VERSION_DATE = "19.09.2023" +VERSION = "0.3.1" +VERSION_DATE = "28.11.2023" diff --git a/packagedoc/additional_docs/History.tex b/packagedoc/additional_docs/History.tex index c45b70e0..e79df44d 100644 --- a/packagedoc/additional_docs/History.tex +++ b/packagedoc/additional_docs/History.tex @@ -34,4 +34,10 @@ - Nested parameters substitution and overwriting improvement\newline - Jsonp file path computation improvement} +\historyversiondate{0.3.1}{11/2023} +\historychange{- Add jsonDump method to write a file in JSON format\newline +- Improve nested parameter format\newline +- Improve error message log\newline +- Fix bugs of data structures implicitly} + \end{packagehistory} diff --git a/test/JPP_TestUsecases.csv b/test/JPP_TestUsecases.csv index e7ce6900..0e4d7cd3 100644 --- a/test/JPP_TestUsecases.csv +++ b/test/JPP_TestUsecases.csv @@ -13,15 +13,26 @@ JPP_0202|PARAMETER_SUBSTITUTION|GOODCASE|JSON file with nested parameter / index JPP_0203|PARAMETER_SUBSTITUTION|GOODCASE|JSON file with nested parameter / index parameter substitution in parameter name / dotdict notation JPP_0204|PARAMETER_SUBSTITUTION|GOODCASE|JSON file with nested parameter / index parameter substitution in parameter value / standard notation JPP_0205|PARAMETER_SUBSTITUTION|GOODCASE|JSON file with nested parameter / index parameter substitution in parameter value / dotdict notation +JPP_0206|PARAMETER_SUBSTITUTION|GOODCASE|JSON file with nested parameter / key parameter substitution in parameter name / standard notation JPP_0207|PARAMETER_SUBSTITUTION|GOODCASE|JSON file with nested parameter / key parameter substitution in parameter name / dotdict notation +JPP_0208|PARAMETER_SUBSTITUTION|GOODCASE|JSON file with nested parameter / key parameter substitution in parameter value / standard notation +JPP_0209|PARAMETER_SUBSTITUTION|GOODCASE|JSON file with nested parameter / key parameter substitution in parameter value / dotdict notation JPP_0250|PARAMETER_SUBSTITUTION|BADCASE|JSON file with nested parameter / string parameter substitution in parameter value / innermost parameter not existing JPP_0251|PARAMETER_SUBSTITUTION|BADCASE|JSON file with nested parameter / string parameter substitution in parameter name / in between parameter not existing JPP_0252|PARAMETER_SUBSTITUTION|BADCASE|JSON file with nested parameter / index parameter substitution in parameter name / standard notation / index parameter not existing JPP_0253|PARAMETER_SUBSTITUTION|BADCASE|JSON file with nested parameter / index parameter substitution in parameter name / dotdict notation / index parameter not existing JPP_0254|PARAMETER_SUBSTITUTION|BADCASE|JSON file with nested parameter / index parameter substitution in parameter value / standard notation / index parameter not existing JPP_0255|PARAMETER_SUBSTITUTION|BADCASE|JSON file with nested parameter / index parameter substitution in parameter value / dotdict notation / index parameter not existing +JPP_0256|PARAMETER_SUBSTITUTION|BADCASE|JSON file with nested parameter / key parameter substitution in parameter name / standard notation / variant number not existing JPP_0257|PARAMETER_SUBSTITUTION|BADCASE|JSON file with nested parameter / key parameter substitution in parameter name / dotdict notation / milestone number not existing +JPP_0258|PARAMETER_SUBSTITUTION|BADCASE|JSON file with nested parameter / key parameter substitution in parameter value / standard notation / variant number not existing JPP_0259|PARAMETER_SUBSTITUTION|BADCASE|JSON file with nested parameter / key parameter substitution in parameter value / dotdict notation / milestone number not existing +JPP_0261|PARAMETER_SUBSTITUTION|BADCASE|JSON file with list parameter substitution in parameter name (composite data types not allowed in names) / (2) +JPP_0263|PARAMETER_SUBSTITUTION|BADCASE|JSON file with dictionary parameter substitution in parameter name (composite data types not allowed in names) / (2) +JPP_0264|PARAMETER_SUBSTITUTION|BADCASE|JSON file with list parameter substitution in key name (composite data types not allowed in names) / (1) +JPP_0265|PARAMETER_SUBSTITUTION|BADCASE|JSON file with list parameter substitution in key name (composite data types not allowed in names) / (2) +JPP_0266|PARAMETER_SUBSTITUTION|BADCASE|JSON file with dictionary parameter substitution in key name (composite data types not allowed in names) / (1) +JPP_0267|PARAMETER_SUBSTITUTION|BADCASE|JSON file with dictionary parameter substitution in key name (composite data types not allowed in names) / (2) JPP_0300|VALUE_DETECTION|GOODCASE|JSON file with parameter of type 'list' / index (in square brackets) defined outside the curly brackets (valid syntax) JPP_0301|VALUE_DETECTION|GOODCASE|JSON file with expression containing more closing elements '}' than opening elements '${' (valid syntax) JPP_0302|VALUE_DETECTION|GOODCASE|JSON file with expression starting with '${' and ending with '}' / no further matching '${' and '}' in between (valid syntax) @@ -36,7 +47,13 @@ JPP_0356|VALUE_DETECTION|BADCASE|JSON file with expression containing more openi JPP_0357|VALUE_DETECTION|BADCASE|JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 5) JPP_0358|VALUE_DETECTION|BADCASE|JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 6) JPP_0359|VALUE_DETECTION|BADCASE|JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 6) +JPP_0360|VALUE_DETECTION|BADCASE|JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 9) JPP_0361|VALUE_DETECTION|BADCASE|JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 1) +JPP_0362|VALUE_DETECTION|BADCASE|JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 2) +JPP_0363|VALUE_DETECTION|BADCASE|JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 3) +JPP_0364|VALUE_DETECTION|BADCASE|JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 4) +JPP_0365|VALUE_DETECTION|BADCASE|JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 5) +JPP_0366|VALUE_DETECTION|BADCASE|JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 6) JPP_0367|VALUE_DETECTION|BADCASE|JSON file with expression starting with '${' and ending with '}', further matching '${' and '}' in between (not all nested) (invalid syntax 1) JPP_0368|VALUE_DETECTION|BADCASE|JSON file with expression starting with '${' and ending with '}', further matching '${' and '}' in between (not all nested) (invalid syntax 2) JPP_0369|VALUE_DETECTION|BADCASE|JSON file with expression starting with '${' and ending with '}', further matching '${' and '}' in between (not all nested) (invalid syntax 3) @@ -45,6 +62,7 @@ JPP_0371|VALUE_DETECTION|BADCASE|JSON file with expression starting with '${' an JPP_0500|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file with composite data structure (nested lists and dictionaries 1) JPP_0501|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file with composite data structure (nested lists and dictionaries 2) JPP_0502|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file with composite data structure (nested lists and dictionaries 3 / some key names with dots inside) +JPP_0503|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file with composite data structure (some lists) JPP_0505|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file with composite strings containing several times a colon and a comma (JSON syntax elements) JPP_0506|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file with composite strings containing several combinations of curly brackets and special characters before JPP_0507|COMPOSITE_EXPRESSIONS|GOODCASE|JSON file containing several string concatenations in separate lines (1) diff --git a/test/JPP_TestUsecases.html b/test/JPP_TestUsecases.html index d092480f..e37e35da 100644 --- a/test/JPP_TestUsecases.html +++ b/test/JPP_TestUsecases.html @@ -463,6 +463,39 @@ 14 + + + +JPP_0206 + + + + +PARAMETER_SUBSTITUTION + + + + +GOODCASE + + + + +JSON file with nested parameter / key parameter substitution in parameter name / standard notation
+Expected: JsonPreprocessor creates a new string with all dollar operator expressions resolved as string + + +
+ + + + + + + +15 + + @@ -493,7 +526,73 @@ -15 +16 + + + + + +JPP_0208 + + + + +PARAMETER_SUBSTITUTION + + + + +GOODCASE + + + + +JSON file with nested parameter / key parameter substitution in parameter value / standard notation
+Expected: JsonPreprocessor creates a new string with all dollar operator expressions resolved as string + + +
+ + + + + + + +17 + + + + + +JPP_0209 + + + + +PARAMETER_SUBSTITUTION + + + + +GOODCASE + + + + +JSON file with nested parameter / key parameter substitution in parameter value / dotdict notation
+Expected: JsonPreprocessor creates a new string with all dollar operator expressions resolved as string + + +
+ + + + + + + +18 @@ -526,7 +625,7 @@ -16 +19 @@ -559,7 +658,7 @@ -17 +20 @@ -592,7 +691,7 @@ -18 +21 @@ -613,10 +712,474 @@ -JSON file with nested parameter / index parameter substitution in parameter name / dotdict notation / index parameter not existing
-Expected: No values are returned, and JsonPreprocessor throws an exception - +JSON file with nested parameter / index parameter substitution in parameter name / dotdict notation / index parameter not existing
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +22 + + + + + +JPP_0254 + + + + +PARAMETER_SUBSTITUTION + + + + +BADCASE + + + + +JSON file with nested parameter / index parameter substitution in parameter value / standard notation / index parameter not existing
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +23 + + + + + +JPP_0255 + + + + +PARAMETER_SUBSTITUTION + + + + +BADCASE + + + + +JSON file with nested parameter / index parameter substitution in parameter value / dotdict notation / index parameter not existing
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +24 + + + + + +JPP_0256 + + + + +PARAMETER_SUBSTITUTION + + + + +BADCASE + + + + +JSON file with nested parameter / key parameter substitution in parameter name / standard notation / variant number not existing
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +25 + + + + + +JPP_0257 + + + + +PARAMETER_SUBSTITUTION + + + + +BADCASE + + + + +JSON file with nested parameter / key parameter substitution in parameter name / dotdict notation / milestone number not existing
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +26 + + + + + +JPP_0258 + + + + +PARAMETER_SUBSTITUTION + + + + +BADCASE + + + + +JSON file with nested parameter / key parameter substitution in parameter value / standard notation / variant number not existing
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +27 + + + + + +JPP_0259 + + + + +PARAMETER_SUBSTITUTION + + + + +BADCASE + + + + +JSON file with nested parameter / key parameter substitution in parameter value / dotdict notation / milestone number not existing
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +28 + + + + + +JPP_0261 + + + + +PARAMETER_SUBSTITUTION + + + + +BADCASE + + + + +JSON file with list parameter substitution in parameter name (composite data types not allowed in names) / (2)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +29 + + + + + +JPP_0263 + + + + +PARAMETER_SUBSTITUTION + + + + +BADCASE + + + + +JSON file with dictionary parameter substitution in parameter name (composite data types not allowed in names) / (2)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +30 + + + + + +JPP_0264 + + + + +PARAMETER_SUBSTITUTION + + + + +BADCASE + + + + +JSON file with list parameter substitution in key name (composite data types not allowed in names) / (1)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +31 + + + + + +JPP_0265 + + + + +PARAMETER_SUBSTITUTION + + + + +BADCASE + + + + +JSON file with list parameter substitution in key name (composite data types not allowed in names) / (2)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +32 + + + + + +JPP_0266 + + + + +PARAMETER_SUBSTITUTION + + + + +BADCASE + + + + +JSON file with dictionary parameter substitution in key name (composite data types not allowed in names) / (1)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +33 + + + + + +JPP_0267 + + + + +PARAMETER_SUBSTITUTION + + + + +BADCASE + + + + +JSON file with dictionary parameter substitution in key name (composite data types not allowed in names) / (2)
+Expected: No values are returned, and JsonPreprocessor throws an exception + + +
+ + + + + + + +34 + + + + + +JPP_0300 + + + + +VALUE_DETECTION + + + + +GOODCASE + + + + +JSON file with parameter of type 'list' / index (in square brackets) defined outside the curly brackets (valid syntax)
+Expected: JsonPreprocessor returns values + +
+Checklist rule 1 +
+ + + + + + + +35 + + + + + +JPP_0301 + + + + +VALUE_DETECTION + + + + +GOODCASE + + + + +JSON file with expression containing more closing elements '}' than opening elements '${' (valid syntax)
+Expected: JsonPreprocessor returns values +
+Checklist rule 3
@@ -625,31 +1188,32 @@ -19 +36 -JPP_0254 +JPP_0302 -PARAMETER_SUBSTITUTION +VALUE_DETECTION - -BADCASE + +GOODCASE -JSON file with nested parameter / index parameter substitution in parameter value / standard notation / index parameter not existing
-Expected: No values are returned, and JsonPreprocessor throws an exception - +JSON file with expression starting with '${' and ending with '}' / no further matching '${' and '}' in between (valid syntax)
+Expected: JsonPreprocessor returns values +
+Checklist rule 4
@@ -658,31 +1222,32 @@ -20 +37 -JPP_0255 +JPP_0304 -PARAMETER_SUBSTITUTION +VALUE_DETECTION - -BADCASE + +GOODCASE -JSON file with nested parameter / index parameter substitution in parameter value / dotdict notation / index parameter not existing
-Expected: No values are returned, and JsonPreprocessor throws an exception - +JSON file with expression starting with '${' and ending with '}', further matching '${' and '}' in between (not all nested) (valid syntax)
+Expected: JsonPreprocessor returns values +
+Checklist rule 6
@@ -691,18 +1256,18 @@ -21 +38 -JPP_0257 +JPP_0350 -PARAMETER_SUBSTITUTION +VALUE_DETECTION @@ -712,10 +1277,11 @@ -JSON file with nested parameter / key parameter substitution in parameter name / dotdict notation / milestone number not existing
+JSON file with parameter of type 'list' / index (in square brackets) defined inside the curly brackets (invalid syntax 1)
Expected: No values are returned, and JsonPreprocessor throws an exception - +
+Checklist rule 1 / pattern 1
@@ -724,18 +1290,18 @@ -22 +39 -JPP_0259 +JPP_0351 -PARAMETER_SUBSTITUTION +VALUE_DETECTION @@ -745,10 +1311,11 @@ -JSON file with nested parameter / key parameter substitution in parameter value / dotdict notation / milestone number not existing
+JSON file with parameter of type 'list' / index (in square brackets) defined inside the curly brackets (invalid syntax 2)
Expected: No values are returned, and JsonPreprocessor throws an exception - +
+Checklist rule 1 / pattern 2
@@ -757,13 +1324,13 @@ -23 +40 -JPP_0300 +JPP_0352 @@ -772,17 +1339,17 @@
- -GOODCASE + +BADCASE -JSON file with parameter of type 'list' / index (in square brackets) defined outside the curly brackets (valid syntax)
-Expected: JsonPreprocessor returns values +JSON file with parameter of type 'list' / index (in square brackets) defined inside the curly brackets (invalid syntax 3)
+Expected: No values are returned, and JsonPreprocessor throws an exception
-Checklist rule 1 +Checklist rule 1 / pattern 3
@@ -791,13 +1358,13 @@ -24 +41 -JPP_0301 +JPP_0353 @@ -806,17 +1373,17 @@
- -GOODCASE + +BADCASE -JSON file with expression containing more closing elements '}' than opening elements '${' (valid syntax)
-Expected: JsonPreprocessor returns values +JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 1)
+Expected: No values are returned, and JsonPreprocessor throws an exception
-Checklist rule 3 +Checklist rule 2 / pattern 1
@@ -825,13 +1392,13 @@ -25 +42 -JPP_0302 +JPP_0354 @@ -840,17 +1407,17 @@
- -GOODCASE + +BADCASE -JSON file with expression starting with '${' and ending with '}' / no further matching '${' and '}' in between (valid syntax)
-Expected: JsonPreprocessor returns values +JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 2)
+Expected: No values are returned, and JsonPreprocessor throws an exception
-Checklist rule 4 +Checklist rule 2 / pattern 2
@@ -859,13 +1426,13 @@ -26 +43 -JPP_0304 +JPP_0355 @@ -874,17 +1441,17 @@
- -GOODCASE + +BADCASE -JSON file with expression starting with '${' and ending with '}', further matching '${' and '}' in between (not all nested) (valid syntax)
-Expected: JsonPreprocessor returns values +JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 3)
+Expected: No values are returned, and JsonPreprocessor throws an exception
-Checklist rule 6 +Checklist rule 2 / pattern 3
@@ -893,13 +1460,13 @@ -27 +44 -JPP_0350 +JPP_0356 @@ -914,11 +1481,11 @@ -JSON file with parameter of type 'list' / index (in square brackets) defined inside the curly brackets (invalid syntax 1)
+JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 4)
Expected: No values are returned, and JsonPreprocessor throws an exception
-Checklist rule 1 / pattern 1 +Checklist rule 2 / pattern 4
@@ -927,13 +1494,13 @@ -28 +45 -JPP_0351 +JPP_0357 @@ -948,11 +1515,11 @@ -JSON file with parameter of type 'list' / index (in square brackets) defined inside the curly brackets (invalid syntax 2)
+JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 5)
Expected: No values are returned, and JsonPreprocessor throws an exception
-Checklist rule 1 / pattern 2 +Checklist rule 2 / pattern 5
@@ -961,13 +1528,13 @@ -29 +46 -JPP_0352 +JPP_0358 @@ -982,11 +1549,11 @@ -JSON file with parameter of type 'list' / index (in square brackets) defined inside the curly brackets (invalid syntax 3)
+JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 6)
Expected: No values are returned, and JsonPreprocessor throws an exception
-Checklist rule 1 / pattern 3 +Checklist rule 2 / pattern 6
@@ -995,13 +1562,13 @@ -30 +47 -JPP_0353 +JPP_0359 @@ -1016,11 +1583,11 @@ -JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 1)
+JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 6)
Expected: No values are returned, and JsonPreprocessor throws an exception
-Checklist rule 2 / pattern 1 +Checklist rule 2 / pattern 7
@@ -1029,13 +1596,13 @@ -31 +48 -JPP_0354 +JPP_0360 @@ -1050,11 +1617,11 @@ -JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 2)
+JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 9)
Expected: No values are returned, and JsonPreprocessor throws an exception
-Checklist rule 2 / pattern 2 +Checklist rule 2 / pattern 8
@@ -1063,13 +1630,13 @@ -32 +49 -JPP_0355 +JPP_0361 @@ -1084,11 +1651,11 @@ -JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 3)
+JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 1)
Expected: No values are returned, and JsonPreprocessor throws an exception
-Checklist rule 2 / pattern 3 +Checklist rule 3 / pattern 1
@@ -1097,13 +1664,13 @@ -33 +50 -JPP_0356 +JPP_0362 @@ -1118,11 +1685,11 @@ -JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 4)
+JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 2)
Expected: No values are returned, and JsonPreprocessor throws an exception
-Checklist rule 2 / pattern 4 +Checklist rule 3 / pattern 2
@@ -1131,13 +1698,13 @@ -34 +51 -JPP_0357 +JPP_0363 @@ -1152,11 +1719,11 @@ -JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 5)
+JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 3)
Expected: No values are returned, and JsonPreprocessor throws an exception
-Checklist rule 2 / pattern 5 +Checklist rule 3 / pattern 3
@@ -1165,13 +1732,13 @@ -35 +52 -JPP_0358 +JPP_0364 @@ -1186,11 +1753,11 @@ -JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 6)
+JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 4)
Expected: No values are returned, and JsonPreprocessor throws an exception
-Checklist rule 2 / pattern 6 +Checklist rule 3 / pattern 4
@@ -1199,13 +1766,13 @@ -36 +53 -JPP_0359 +JPP_0365 @@ -1220,11 +1787,11 @@ -JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 6)
+JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 5)
Expected: No values are returned, and JsonPreprocessor throws an exception
-Checklist rule 2 / pattern 7 +Checklist rule 3 / pattern 5
@@ -1233,13 +1800,13 @@ -37 +54 -JPP_0361 +JPP_0366 @@ -1254,11 +1821,11 @@ -JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 1)
+JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 6)
Expected: No values are returned, and JsonPreprocessor throws an exception
-Checklist rule 3 / pattern 1 +Checklist rule 3 / pattern 6
@@ -1267,7 +1834,7 @@ -38 +55 @@ -1301,7 +1868,7 @@ -39 +56 @@ -1335,7 +1902,7 @@ -40 +57 @@ -1369,7 +1936,7 @@ -41 +58 @@ -1403,7 +1970,7 @@ -42 +59 @@ -1437,7 +2004,7 @@ -43 +60 @@ -1471,7 +2038,7 @@ -44 +61 @@ -1505,7 +2072,7 @@ -45 +62 @@ -1539,7 +2106,40 @@ -46 +63 + + + + + +JPP_0503 + + + + +COMPOSITE_EXPRESSIONS + + + + +GOODCASE + + + + +JSON file with composite data structure (some lists)
+Expected: JsonPreprocessor returns expected value + + +
+ + + + + + + +64 @@ -1572,7 +2172,7 @@ -47 +65 @@ -1605,7 +2205,7 @@ -48 +66 @@ -1638,7 +2238,7 @@ -49 +67 @@ -1671,7 +2271,7 @@ -50 +68 @@ -1704,7 +2304,7 @@ -51 +69 @@ -1737,7 +2337,7 @@ -52 +70 @@ -1771,7 +2371,7 @@ -53 +71 @@ -1804,7 +2404,7 @@ -54 +72 @@ -1837,7 +2437,7 @@ -55 +73 @@ -1870,7 +2470,7 @@ -56 +74 @@ -1903,7 +2503,7 @@ -57 +75 @@ -1936,7 +2536,7 @@ -58 +76 @@ -1969,7 +2569,7 @@ -59 +77 @@ -2002,7 +2602,7 @@ -60 +78 @@ -2035,7 +2635,7 @@ -61 +79 @@ -2068,7 +2668,7 @@ -62 +80 @@ -2101,7 +2701,7 @@ -63 +81 @@ -2135,7 +2735,7 @@
 

-
Generated: 18.10.2023 - 17:37:45
+
Generated: 20.11.2023 - 15:42:16
 
diff --git a/test/JPP_TestUsecases.rst b/test/JPP_TestUsecases.rst index 7c806efd..b8213208 100644 --- a/test/JPP_TestUsecases.rst +++ b/test/JPP_TestUsecases.rst @@ -145,6 +145,16 @@ Test Use Cases ---- +* **Test JPP_0206** + + [PARAMETER_SUBSTITUTION / GOODCASE] + + **JSON file with nested parameter / key parameter substitution in parameter name / standard notation** + + Expected: JsonPreprocessor creates a new string with all dollar operator expressions resolved as string + +---- + * **Test JPP_0207** [PARAMETER_SUBSTITUTION / GOODCASE] @@ -155,6 +165,26 @@ Test Use Cases ---- +* **Test JPP_0208** + + [PARAMETER_SUBSTITUTION / GOODCASE] + + **JSON file with nested parameter / key parameter substitution in parameter value / standard notation** + + Expected: JsonPreprocessor creates a new string with all dollar operator expressions resolved as string + +---- + +* **Test JPP_0209** + + [PARAMETER_SUBSTITUTION / GOODCASE] + + **JSON file with nested parameter / key parameter substitution in parameter value / dotdict notation** + + Expected: JsonPreprocessor creates a new string with all dollar operator expressions resolved as string + +---- + * **Test JPP_0250** [PARAMETER_SUBSTITUTION / BADCASE] @@ -215,6 +245,16 @@ Test Use Cases ---- +* **Test JPP_0256** + + [PARAMETER_SUBSTITUTION / BADCASE] + + **JSON file with nested parameter / key parameter substitution in parameter name / standard notation / variant number not existing** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + * **Test JPP_0257** [PARAMETER_SUBSTITUTION / BADCASE] @@ -225,6 +265,16 @@ Test Use Cases ---- +* **Test JPP_0258** + + [PARAMETER_SUBSTITUTION / BADCASE] + + **JSON file with nested parameter / key parameter substitution in parameter value / standard notation / variant number not existing** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + * **Test JPP_0259** [PARAMETER_SUBSTITUTION / BADCASE] @@ -235,6 +285,66 @@ Test Use Cases ---- +* **Test JPP_0261** + + [PARAMETER_SUBSTITUTION / BADCASE] + + **JSON file with list parameter substitution in parameter name (composite data types not allowed in names) / (2)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + +* **Test JPP_0263** + + [PARAMETER_SUBSTITUTION / BADCASE] + + **JSON file with dictionary parameter substitution in parameter name (composite data types not allowed in names) / (2)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + +* **Test JPP_0264** + + [PARAMETER_SUBSTITUTION / BADCASE] + + **JSON file with list parameter substitution in key name (composite data types not allowed in names) / (1)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + +* **Test JPP_0265** + + [PARAMETER_SUBSTITUTION / BADCASE] + + **JSON file with list parameter substitution in key name (composite data types not allowed in names) / (2)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + +* **Test JPP_0266** + + [PARAMETER_SUBSTITUTION / BADCASE] + + **JSON file with dictionary parameter substitution in key name (composite data types not allowed in names) / (1)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + +* **Test JPP_0267** + + [PARAMETER_SUBSTITUTION / BADCASE] + + **JSON file with dictionary parameter substitution in key name (composite data types not allowed in names) / (2)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + +---- + * **Test JPP_0300** [VALUE_DETECTION / GOODCASE] @@ -403,6 +513,18 @@ Test Use Cases ---- +* **Test JPP_0360** + + [VALUE_DETECTION / BADCASE] + + **JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 9)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + + *Hint: Checklist rule 2 / pattern 8* + +---- + * **Test JPP_0361** [VALUE_DETECTION / BADCASE] @@ -415,6 +537,66 @@ Test Use Cases ---- +* **Test JPP_0362** + + [VALUE_DETECTION / BADCASE] + + **JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 2)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + + *Hint: Checklist rule 3 / pattern 2* + +---- + +* **Test JPP_0363** + + [VALUE_DETECTION / BADCASE] + + **JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 3)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + + *Hint: Checklist rule 3 / pattern 3* + +---- + +* **Test JPP_0364** + + [VALUE_DETECTION / BADCASE] + + **JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 4)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + + *Hint: Checklist rule 3 / pattern 4* + +---- + +* **Test JPP_0365** + + [VALUE_DETECTION / BADCASE] + + **JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 5)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + + *Hint: Checklist rule 3 / pattern 5* + +---- + +* **Test JPP_0366** + + [VALUE_DETECTION / BADCASE] + + **JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 6)** + + Expected: No values are returned, and JsonPreprocessor throws an exception + + *Hint: Checklist rule 3 / pattern 6* + +---- + * **Test JPP_0367** [VALUE_DETECTION / BADCASE] @@ -511,6 +693,16 @@ Test Use Cases ---- +* **Test JPP_0503** + + [COMPOSITE_EXPRESSIONS / GOODCASE] + + **JSON file with composite data structure (some lists)** + + Expected: JsonPreprocessor returns expected value + +---- + * **Test JPP_0505** [COMPOSITE_EXPRESSIONS / GOODCASE] @@ -695,5 +887,5 @@ Test Use Cases ---- -Generated: 18.10.2023 - 17:37:45 +Generated: 20.11.2023 - 15:42:16 diff --git a/test/JPP_TestUsecases.txt b/test/JPP_TestUsecases.txt index c1646d12..41d51a22 100644 --- a/test/JPP_TestUsecases.txt +++ b/test/JPP_TestUsecases.txt @@ -67,10 +67,22 @@ Test JPP_0205 / PARAMETER_SUBSTITUTION / GOODCASE Description: JSON file with nested parameter / index parameter substitution in parameter value / dotdict notation Expectation: JsonPreprocessor creates a new string with all dollar operator expressions resolved as string ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0206 / PARAMETER_SUBSTITUTION / GOODCASE +Description: JSON file with nested parameter / key parameter substitution in parameter name / standard notation +Expectation: JsonPreprocessor creates a new string with all dollar operator expressions resolved as string +------------------------------------------------------------------------------------------------------------------------ Test JPP_0207 / PARAMETER_SUBSTITUTION / GOODCASE Description: JSON file with nested parameter / key parameter substitution in parameter name / dotdict notation Expectation: JsonPreprocessor creates a new string with all dollar operator expressions resolved as string ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0208 / PARAMETER_SUBSTITUTION / GOODCASE +Description: JSON file with nested parameter / key parameter substitution in parameter value / standard notation +Expectation: JsonPreprocessor creates a new string with all dollar operator expressions resolved as string +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0209 / PARAMETER_SUBSTITUTION / GOODCASE +Description: JSON file with nested parameter / key parameter substitution in parameter value / dotdict notation +Expectation: JsonPreprocessor creates a new string with all dollar operator expressions resolved as string +------------------------------------------------------------------------------------------------------------------------ Test JPP_0250 / PARAMETER_SUBSTITUTION / BADCASE Description: JSON file with nested parameter / string parameter substitution in parameter value / innermost parameter not existing Expectation: No values are returned, and JsonPreprocessor throws an exception @@ -95,14 +107,46 @@ Test JPP_0255 / PARAMETER_SUBSTITUTION / BADCASE Description: JSON file with nested parameter / index parameter substitution in parameter value / dotdict notation / index parameter not existing Expectation: No values are returned, and JsonPreprocessor throws an exception ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0256 / PARAMETER_SUBSTITUTION / BADCASE +Description: JSON file with nested parameter / key parameter substitution in parameter name / standard notation / variant number not existing +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ Test JPP_0257 / PARAMETER_SUBSTITUTION / BADCASE Description: JSON file with nested parameter / key parameter substitution in parameter name / dotdict notation / milestone number not existing Expectation: No values are returned, and JsonPreprocessor throws an exception ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0258 / PARAMETER_SUBSTITUTION / BADCASE +Description: JSON file with nested parameter / key parameter substitution in parameter value / standard notation / variant number not existing +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ Test JPP_0259 / PARAMETER_SUBSTITUTION / BADCASE Description: JSON file with nested parameter / key parameter substitution in parameter value / dotdict notation / milestone number not existing Expectation: No values are returned, and JsonPreprocessor throws an exception ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0261 / PARAMETER_SUBSTITUTION / BADCASE +Description: JSON file with list parameter substitution in parameter name (composite data types not allowed in names) / (2) +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0263 / PARAMETER_SUBSTITUTION / BADCASE +Description: JSON file with dictionary parameter substitution in parameter name (composite data types not allowed in names) / (2) +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0264 / PARAMETER_SUBSTITUTION / BADCASE +Description: JSON file with list parameter substitution in key name (composite data types not allowed in names) / (1) +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0265 / PARAMETER_SUBSTITUTION / BADCASE +Description: JSON file with list parameter substitution in key name (composite data types not allowed in names) / (2) +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0266 / PARAMETER_SUBSTITUTION / BADCASE +Description: JSON file with dictionary parameter substitution in key name (composite data types not allowed in names) / (1) +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0267 / PARAMETER_SUBSTITUTION / BADCASE +Description: JSON file with dictionary parameter substitution in key name (composite data types not allowed in names) / (2) +Expectation: No values are returned, and JsonPreprocessor throws an exception +------------------------------------------------------------------------------------------------------------------------ Test JPP_0300 / VALUE_DETECTION / GOODCASE Description: JSON file with parameter of type 'list' / index (in square brackets) defined outside the curly brackets (valid syntax) Expectation: JsonPreprocessor returns values @@ -173,11 +217,41 @@ Description: JSON file with expression containing more opening elements '${' tha Expectation: No values are returned, and JsonPreprocessor throws an exception Hint.......: Checklist rule 2 / pattern 7 ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0360 / VALUE_DETECTION / BADCASE +Description: JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 9) +Expectation: No values are returned, and JsonPreprocessor throws an exception +Hint.......: Checklist rule 2 / pattern 8 +------------------------------------------------------------------------------------------------------------------------ Test JPP_0361 / VALUE_DETECTION / BADCASE Description: JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 1) Expectation: No values are returned, and JsonPreprocessor throws an exception Hint.......: Checklist rule 3 / pattern 1 ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0362 / VALUE_DETECTION / BADCASE +Description: JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 2) +Expectation: No values are returned, and JsonPreprocessor throws an exception +Hint.......: Checklist rule 3 / pattern 2 +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0363 / VALUE_DETECTION / BADCASE +Description: JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 3) +Expectation: No values are returned, and JsonPreprocessor throws an exception +Hint.......: Checklist rule 3 / pattern 3 +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0364 / VALUE_DETECTION / BADCASE +Description: JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 4) +Expectation: No values are returned, and JsonPreprocessor throws an exception +Hint.......: Checklist rule 3 / pattern 4 +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0365 / VALUE_DETECTION / BADCASE +Description: JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 5) +Expectation: No values are returned, and JsonPreprocessor throws an exception +Hint.......: Checklist rule 3 / pattern 5 +------------------------------------------------------------------------------------------------------------------------ +Test JPP_0366 / VALUE_DETECTION / BADCASE +Description: JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 6) +Expectation: No values are returned, and JsonPreprocessor throws an exception +Hint.......: Checklist rule 3 / pattern 6 +------------------------------------------------------------------------------------------------------------------------ Test JPP_0367 / VALUE_DETECTION / BADCASE Description: JSON file with expression starting with '${' and ending with '}', further matching '${' and '}' in between (not all nested) (invalid syntax 1) Expectation: No values are returned, and JsonPreprocessor throws an exception @@ -218,6 +292,10 @@ Description: JSON file with composite data structure (nested lists and dictionar Expectation: JsonPreprocessor returns expected value Hint.......: Standard notation ------------------------------------------------------------------------------------------------------------------------ +Test JPP_0503 / COMPOSITE_EXPRESSIONS / GOODCASE +Description: JSON file with composite data structure (some lists) +Expectation: JsonPreprocessor returns expected value +------------------------------------------------------------------------------------------------------------------------ Test JPP_0505 / COMPOSITE_EXPRESSIONS / GOODCASE Description: JSON file with composite strings containing several times a colon and a comma (JSON syntax elements) Expectation: JsonPreprocessor returns expected value @@ -292,5 +370,5 @@ Description: Relative path to JSON file Expectation: JsonPreprocessor resolves the relative path and returns values from JSON file Hint.......: Works with raw path to JSON file (path not normalized internally) ------------------------------------------------------------------------------------------------------------------------ -Generated: 18.10.2023 - 17:37:45 +Generated: 20.11.2023 - 15:42:16 diff --git a/test/component_test.py b/test/component_test.py index 6e285531..15f7fefc 100644 --- a/test/component_test.py +++ b/test/component_test.py @@ -22,8 +22,8 @@ # # -------------------------------------------------------------------------------------------------------------- # -VERSION = "0.18.0" -VERSION_DATE = "18.10.2023" +VERSION = "0.19.0" +VERSION_DATE = "20.11.2023" # # -------------------------------------------------------------------------------------------------------------- #TM*** diff --git a/test/pytest/pytestfiles/test_03_PARAMETER_SUBSTITUTION_GOODCASE.py b/test/pytest/pytestfiles/test_03_PARAMETER_SUBSTITUTION_GOODCASE.py index e9ad6163..0a3a7454 100644 --- a/test/pytest/pytestfiles/test_03_PARAMETER_SUBSTITUTION_GOODCASE.py +++ b/test/pytest/pytestfiles/test_03_PARAMETER_SUBSTITUTION_GOODCASE.py @@ -18,7 +18,7 @@ # # XC-CT/ECA3-Queckenstedt # -# 10.10.2023 - 13:31:11 +# 20.11.2023 - 15:42:16 # # -------------------------------------------------------------------------------------------------------------- @@ -77,6 +77,14 @@ def test_JPP_0204(self, Description): def test_JPP_0205(self, Description): nReturn = CExecute.Execute("JPP_0205") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: JsonPreprocessor creates a new string with all dollar operator expressions resolved as string + @pytest.mark.parametrize( + "Description", ["JSON file with nested parameter / key parameter substitution in parameter name / standard notation",] + ) + def test_JPP_0206(self, Description): + nReturn = CExecute.Execute("JPP_0206") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- # Expected: JsonPreprocessor creates a new string with all dollar operator expressions resolved as string @pytest.mark.parametrize( @@ -85,4 +93,20 @@ def test_JPP_0205(self, Description): def test_JPP_0207(self, Description): nReturn = CExecute.Execute("JPP_0207") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: JsonPreprocessor creates a new string with all dollar operator expressions resolved as string + @pytest.mark.parametrize( + "Description", ["JSON file with nested parameter / key parameter substitution in parameter value / standard notation",] + ) + def test_JPP_0208(self, Description): + nReturn = CExecute.Execute("JPP_0208") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: JsonPreprocessor creates a new string with all dollar operator expressions resolved as string + @pytest.mark.parametrize( + "Description", ["JSON file with nested parameter / key parameter substitution in parameter value / dotdict notation",] + ) + def test_JPP_0209(self, Description): + nReturn = CExecute.Execute("JPP_0209") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_04_PARAMETER_SUBSTITUTION_BADCASE.py b/test/pytest/pytestfiles/test_04_PARAMETER_SUBSTITUTION_BADCASE.py index 9087124c..279acb4b 100644 --- a/test/pytest/pytestfiles/test_04_PARAMETER_SUBSTITUTION_BADCASE.py +++ b/test/pytest/pytestfiles/test_04_PARAMETER_SUBSTITUTION_BADCASE.py @@ -18,7 +18,7 @@ # # XC-CT/ECA3-Queckenstedt # -# 10.10.2023 - 13:31:11 +# 20.11.2023 - 15:42:16 # # -------------------------------------------------------------------------------------------------------------- @@ -77,6 +77,14 @@ def test_JPP_0254(self, Description): def test_JPP_0255(self, Description): nReturn = CExecute.Execute("JPP_0255") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with nested parameter / key parameter substitution in parameter name / standard notation / variant number not existing",] + ) + def test_JPP_0256(self, Description): + nReturn = CExecute.Execute("JPP_0256") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- # Expected: No values are returned, and JsonPreprocessor throws an exception @pytest.mark.parametrize( @@ -85,6 +93,14 @@ def test_JPP_0255(self, Description): def test_JPP_0257(self, Description): nReturn = CExecute.Execute("JPP_0257") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with nested parameter / key parameter substitution in parameter value / standard notation / variant number not existing",] + ) + def test_JPP_0258(self, Description): + nReturn = CExecute.Execute("JPP_0258") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- # Expected: No values are returned, and JsonPreprocessor throws an exception @pytest.mark.parametrize( @@ -93,4 +109,52 @@ def test_JPP_0257(self, Description): def test_JPP_0259(self, Description): nReturn = CExecute.Execute("JPP_0259") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with list parameter substitution in parameter name (composite data types not allowed in names) / (2)",] + ) + def test_JPP_0261(self, Description): + nReturn = CExecute.Execute("JPP_0261") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with dictionary parameter substitution in parameter name (composite data types not allowed in names) / (2)",] + ) + def test_JPP_0263(self, Description): + nReturn = CExecute.Execute("JPP_0263") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with list parameter substitution in key name (composite data types not allowed in names) / (1)",] + ) + def test_JPP_0264(self, Description): + nReturn = CExecute.Execute("JPP_0264") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with list parameter substitution in key name (composite data types not allowed in names) / (2)",] + ) + def test_JPP_0265(self, Description): + nReturn = CExecute.Execute("JPP_0265") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with dictionary parameter substitution in key name (composite data types not allowed in names) / (1)",] + ) + def test_JPP_0266(self, Description): + nReturn = CExecute.Execute("JPP_0266") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with dictionary parameter substitution in key name (composite data types not allowed in names) / (2)",] + ) + def test_JPP_0267(self, Description): + nReturn = CExecute.Execute("JPP_0267") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- diff --git a/test/pytest/pytestfiles/test_06_VALUE_DETECTION_BADCASE.py b/test/pytest/pytestfiles/test_06_VALUE_DETECTION_BADCASE.py index 34b47d4e..216473b4 100644 --- a/test/pytest/pytestfiles/test_06_VALUE_DETECTION_BADCASE.py +++ b/test/pytest/pytestfiles/test_06_VALUE_DETECTION_BADCASE.py @@ -18,7 +18,7 @@ # # XC-CT/ECA3-Queckenstedt # -# 10.10.2023 - 13:31:11 +# 20.11.2023 - 15:42:16 # # -------------------------------------------------------------------------------------------------------------- @@ -109,6 +109,14 @@ def test_JPP_0358(self, Description): def test_JPP_0359(self, Description): nReturn = CExecute.Execute("JPP_0359") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with expression containing more opening elements '${' than closing elements '}' (invalid syntax 9)",] + ) + def test_JPP_0360(self, Description): + nReturn = CExecute.Execute("JPP_0360") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- # Expected: No values are returned, and JsonPreprocessor throws an exception @pytest.mark.parametrize( @@ -117,6 +125,46 @@ def test_JPP_0359(self, Description): def test_JPP_0361(self, Description): nReturn = CExecute.Execute("JPP_0361") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 2)",] + ) + def test_JPP_0362(self, Description): + nReturn = CExecute.Execute("JPP_0362") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 3)",] + ) + def test_JPP_0363(self, Description): + nReturn = CExecute.Execute("JPP_0363") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 4)",] + ) + def test_JPP_0364(self, Description): + nReturn = CExecute.Execute("JPP_0364") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 5)",] + ) + def test_JPP_0365(self, Description): + nReturn = CExecute.Execute("JPP_0365") + assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: No values are returned, and JsonPreprocessor throws an exception + @pytest.mark.parametrize( + "Description", ["JSON file with expression containing more closing elements '}' than opening elements '${' (invalid syntax 6)",] + ) + def test_JPP_0366(self, Description): + nReturn = CExecute.Execute("JPP_0366") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- # Expected: No values are returned, and JsonPreprocessor throws an exception @pytest.mark.parametrize( diff --git a/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py b/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py index 95f0ff5b..ebbf359d 100644 --- a/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py +++ b/test/pytest/pytestfiles/test_07_COMPOSITE_EXPRESSIONS_GOODCASE.py @@ -18,7 +18,7 @@ # # XC-CT/ECA3-Queckenstedt # -# 18.10.2023 - 17:37:45 +# 20.11.2023 - 15:42:16 # # -------------------------------------------------------------------------------------------------------------- @@ -53,6 +53,14 @@ def test_JPP_0501(self, Description): def test_JPP_0502(self, Description): nReturn = CExecute.Execute("JPP_0502") assert nReturn == 0 +# -------------------------------------------------------------------------------------------------------------- + # Expected: JsonPreprocessor returns expected value + @pytest.mark.parametrize( + "Description", ["JSON file with composite data structure (some lists)",] + ) + def test_JPP_0503(self, Description): + nReturn = CExecute.Execute("JPP_0503") + assert nReturn == 0 # -------------------------------------------------------------------------------------------------------------- # Expected: JsonPreprocessor returns expected value @pytest.mark.parametrize( diff --git a/test/testconfig/TestConfig.py b/test/testconfig/TestConfig.py index c98cbb8a..3cb356ce 100644 --- a/test/testconfig/TestConfig.py +++ b/test/testconfig/TestConfig.py @@ -896,7 +896,7 @@ [DICT] (22/21) > {milestone} [STR] : 'milestone' [DICT] (22/22) > {VAR_VARIANT_1_MS_MILESTONE_2_param} [STR] : 'value' """ -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -982,7 +982,7 @@ [DICT] (22/21) > {milestone} [STR] : 'milestone' [DICT] (22/22) > {param} [STR] : 'VAR_VARIANT_1_MS_MILESTONE_2 value' """ -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1025,7 +1025,7 @@ [DICT] (22/21) > {milestone} [STR] : 'milestone' [DICT] (22/22) > {param} [STR] : 'VAR_VARIANT_1_MS_MILESTONE_2 value' """ -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- @@ -1124,7 +1124,7 @@ dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0256.jsonp" dictUsecase['EXPECTEDEXCEPTION'] = "The variable '${IAMNOTEXISTING}' is not available!" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1152,7 +1152,7 @@ dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0258.jsonp" dictUsecase['EXPECTEDEXCEPTION'] = "The variable '${IAMNOTEXISTING}' is not available!" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1192,9 +1192,9 @@ dictUsecase['HINT'] = None dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0261.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "composite data types not allowed in names (placeholder)" +dictUsecase['EXPECTEDEXCEPTION'] = "Composite data types are not allowed" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1220,9 +1220,9 @@ dictUsecase['HINT'] = None dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0263.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "composite data types not allowed in names (placeholder)" +dictUsecase['EXPECTEDEXCEPTION'] = "Composite data types are not allowed" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1234,9 +1234,9 @@ dictUsecase['HINT'] = None dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0264.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "composite data types not allowed in names (placeholder)" +dictUsecase['EXPECTEDEXCEPTION'] = "Composite data types are not allowed" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1248,9 +1248,9 @@ dictUsecase['HINT'] = None dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0265.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "composite data types not allowed in names (placeholder)" +dictUsecase['EXPECTEDEXCEPTION'] = "Composite data types are not allowed" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1262,9 +1262,9 @@ dictUsecase['HINT'] = None dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0266.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "composite data types not allowed in names (placeholder)" +dictUsecase['EXPECTEDEXCEPTION'] = "Composite data types are not allowed" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1276,9 +1276,9 @@ dictUsecase['HINT'] = None dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0267.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "composite data types not allowed in names (placeholder)" +dictUsecase['EXPECTEDEXCEPTION'] = "Composite data types are not allowed" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------- @@ -1415,7 +1415,7 @@ dictUsecase['HINT'] = "Checklist rule 1 / pattern 1" dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0350.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "Invalid parameter format" +dictUsecase['EXPECTEDEXCEPTION'] = "Invalid syntax: Found index" dictUsecase['EXPECTEDRETURN'] = None listofdictUsecases.append(dictUsecase) del dictUsecase @@ -1429,7 +1429,7 @@ dictUsecase['HINT'] = "Checklist rule 1 / pattern 2" dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0351.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "Invalid parameter format" +dictUsecase['EXPECTEDEXCEPTION'] = "Invalid syntax: Found index" dictUsecase['EXPECTEDRETURN'] = None listofdictUsecases.append(dictUsecase) del dictUsecase @@ -1443,7 +1443,7 @@ dictUsecase['HINT'] = "Checklist rule 1 / pattern 3" dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0352.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "Invalid parameter format" +dictUsecase['EXPECTEDEXCEPTION'] = "Invalid syntax: Found index" dictUsecase['EXPECTEDRETURN'] = None listofdictUsecases.append(dictUsecase) del dictUsecase @@ -1555,9 +1555,9 @@ dictUsecase['HINT'] = "Checklist rule 2 / pattern 8" dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0360.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "invalid syntax (placeholder)" +dictUsecase['EXPECTEDEXCEPTION'] = "One or more than one opened or closed curly bracket is missing in expression" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1583,9 +1583,9 @@ dictUsecase['HINT'] = "Checklist rule 3 / pattern 2" dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0362.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "invalid syntax (placeholder)" +dictUsecase['EXPECTEDEXCEPTION'] = "Invalid nested parameter format" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1597,9 +1597,9 @@ dictUsecase['HINT'] = "Checklist rule 3 / pattern 3" dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0363.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "invalid syntax (placeholder)" +dictUsecase['EXPECTEDEXCEPTION'] = "Invalid nested parameter format" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1611,9 +1611,9 @@ dictUsecase['HINT'] = "Checklist rule 3 / pattern 4" dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0364.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "invalid syntax (placeholder)" +dictUsecase['EXPECTEDEXCEPTION'] = "Invalid nested parameter format" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1625,9 +1625,9 @@ dictUsecase['HINT'] = "Checklist rule 3 / pattern 5" dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0365.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "invalid syntax (placeholder)" +dictUsecase['EXPECTEDEXCEPTION'] = "Invalid nested parameter format" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1639,9 +1639,9 @@ dictUsecase['HINT'] = "Checklist rule 3 / pattern 6" dictUsecase['COMMENT'] = None dictUsecase['JSONFILE'] = r"..\testfiles\jpp-test_config_0366.jsonp" -dictUsecase['EXPECTEDEXCEPTION'] = "invalid syntax (placeholder)" +dictUsecase['EXPECTEDEXCEPTION'] = "Invalid nested parameter format" dictUsecase['EXPECTEDRETURN'] = None -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {} @@ -1833,7 +1833,7 @@ [DICT] (10/9) > {val5} [INT] : 2 [DICT] (10/10) > {val6} [STR] : '2' """ -# # # listofdictUsecases.append(dictUsecase) +listofdictUsecases.append(dictUsecase) del dictUsecase # -------------------------------------------------------------------------------------------------------------- dictUsecase = {}