Skip to content

Commit

Permalink
Minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
rquidute committed Nov 8, 2023
1 parent fe24421 commit e8c6ef7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

ARG_STEP_DESCRIPTION_INDEX = 1
KEYWORD_IS_COMISSIONING_INDEX = 0
BODY_INDEX = 0


class PythonParserException(Exception):
Expand Down Expand Up @@ -68,7 +69,7 @@ def __extract_tcs_info(path: Path) -> Tuple[str, List[PythonTestStep]]:
methods = [m for m in class_.body if isinstance(m, ast.FunctionDef)]
for method in methods:
if "desc_" in method.name:
tc_desc = method.body[0].value.value
tc_desc = method.body[BODY_INDEX].value.value
elif "steps_" in method.name:
tc_steps = __retrieve_steps(method)

Expand All @@ -77,7 +78,7 @@ def __extract_tcs_info(path: Path) -> Tuple[str, List[PythonTestStep]]:

def __retrieve_steps(method: ast.FunctionDef) -> List[PythonTestStep]:
python_steps: List[PythonTestStep] = []
for step in method.body[0].value.elts:
for step in method.body[BODY_INDEX].value.elts:
step_name = step.args[ARG_STEP_DESCRIPTION_INDEX].value
arg_is_commissioning = False
if (
Expand Down

0 comments on commit e8c6ef7

Please sign in to comment.