diff --git a/lobster/tools/coda/coda.py b/lobster/tools/coda/coda.py index 1ab4c565..6fafc23c 100644 --- a/lobster/tools/coda/coda.py +++ b/lobster/tools/coda/coda.py @@ -98,7 +98,8 @@ def parse_config_file(file_name: str) -> dict: if (OUTPUT not in config_dict.keys() or CODEBEAMER_URL not in config_dict.keys()): raise ValueError(f'Please follow the right config file structure! ' - f'Missing attribute "{OUTPUT}" and "{CODEBEAMER_URL}"') + f'Missing attribute "{OUTPUT}" and ' + f'"{CODEBEAMER_URL}"') output_config_dict = config_dict.get(OUTPUT) diff --git a/lobster/tools/coda/parser/constants.py b/lobster/tools/coda/parser/constants.py index 6e7c3c2e..30a82fcc 100644 --- a/lobster/tools/coda/parser/constants.py +++ b/lobster/tools/coda/parser/constants.py @@ -6,12 +6,13 @@ def __init__(self, codebeamer_url = ''): self.CODEBEAMER_LINK = codebeamer_url + "/issue/" self.REQUIREMENT = re.compile(r".*[@\\]requirement\s+" - r"([\s*/]*(((CB-#)|({}))\d+)\s*,?)+" - .format(self.CODEBEAMER_LINK)) + r"([\s*/]*(((CB-#)|({}))\d+)\s*,?)+" + .format(self.CODEBEAMER_LINK)) self.REQUIREMENT_TAG_HTTP = ((r"([@\\]requirement(\s+" - r"(CB-#\d+\s+)*({}\d+\s*,?\s*/*\*?)+)+)") - .format(self.CODEBEAMER_LINK)) - self.REQUIREMENT_TAG_HTTP_NAMED = r"({}(?P\d+))".format(self.CODEBEAMER_LINK) + r"(CB-#\d+\s+)*({}\d+\s*,?\s*/*\*?)+)+)") + .format(self.CODEBEAMER_LINK)) + self.REQUIREMENT_TAG_HTTP_NAMED = (r"({}(?P\d+))" + .format(self.CODEBEAMER_LINK)) NON_EXISTING_INFO = "---" @@ -61,4 +62,4 @@ def __init__(self, codebeamer_url = ''): # TESTMETHODS = re.compile(r"(@testmethods\s+ # )((" + "|".join(VALID_TESTMETHODS) + # ")([,]? (" + "|".join(VALID_TESTMETHODS) + "))*)+") - TEST = re.compile(r"(@test\s+)([^@]+)") \ No newline at end of file + TEST = re.compile(r"(@test\s+)([^@]+)") diff --git a/lobster/tools/coda/parser/requirements_parser.py b/lobster/tools/coda/parser/requirements_parser.py index 1172cd2b..bb9c2def 100644 --- a/lobster/tools/coda/parser/requirements_parser.py +++ b/lobster/tools/coda/parser/requirements_parser.py @@ -31,13 +31,15 @@ def collect_test_cases_for_test_files(test_files: List[Path], test_cases = [] for file in set(test_files): - file_test_cases = ParserForRequirements.collect_test_cases(file, codebeamer_url) + file_test_cases = ( + ParserForRequirements.collect_test_cases(file, codebeamer_url)) test_cases.extend(file_test_cases) return test_cases @staticmethod - def collect_test_cases(file: Path, codebeamer_url: str = "") -> List[TestCase]: + def collect_test_cases(file: Path, codebeamer_url: str = "") \ + -> List[TestCase]: """ Parse a source file for test cases diff --git a/lobster/tools/coda/parser/test_case.py b/lobster/tools/coda/parser/test_case.py index 5467b524..b2e52376 100644 --- a/lobster/tools/coda/parser/test_case.py +++ b/lobster/tools/coda/parser/test_case.py @@ -197,7 +197,8 @@ def _get_testmethod_tag(self) -> List[str]: the value is dropped from the list """ test_methods_list = [] - test_methods = self._add_multiline_attribute(self.constants.TESTMETHODS) + test_methods = ( + self._add_multiline_attribute(self.constants.TESTMETHODS)) for test_method in test_methods.split(): if test_method in self.constants.VALID_TESTMETHODS: test_methods_list.append(test_method) @@ -290,7 +291,13 @@ def try_parse(file, lines, start_idx, codebeamer_url = ""): lines -- lines to parse start_idx -- index into lines where to start parsing """ - return TestCase.try_parse_general(file, lines, start_idx, TestCase, codebeamer_url) + return TestCase.try_parse_general( + file, + lines, + start_idx, + TestCase, + codebeamer_url + ) @staticmethod def try_parse_general(file, lines, start_idx, case, codebeamer_url):