Skip to content

Add python tests model classes #16

Add python tests model classes

Add python tests model classes #16

GitHub Actions / Black failed Nov 8, 2023 in 0s

3 errors

Black found 3 errors

Annotations

Check failure on line 86 in /home/runner/work/certification-tool-backend/certification-tool-backend/test_collections/sdk_tests/support/python_testing/models/python_test_parser.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/certification-tool-backend/certification-tool-backend/test_collections/sdk_tests/support/python_testing/models/python_test_parser.py#L66-L86

 
         for class_ in classes:
             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[BODY_INDEX].value.value # type: ignore
+                    tc_desc = method.body[BODY_INDEX].value.value  # type: ignore
                 elif "steps_" in method.name:
                     tc_steps = __retrieve_steps(method)
 
     return tc_desc, tc_steps
 
 
 def __retrieve_steps(method: ast.FunctionDef) -> List[PythonTestStep]:
     python_steps: List[PythonTestStep] = []
-    for step in method.body[BODY_INDEX].value.elts: # type: ignore
+    for step in method.body[BODY_INDEX].value.elts:  # type: ignore
         step_name = step.args[ARG_STEP_DESCRIPTION_INDEX].value
         arg_is_commissioning = False
         if (
             step.keywords
             and "is_commissioning" in step.keywords[KEYWORD_IS_COMISSIONING_INDEX].arg

Check failure on line 42 in /home/runner/work/certification-tool-backend/certification-tool-backend/test_collections/sdk_tests/support/python_testing/models/test_case.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/certification-tool-backend/certification-tool-backend/test_collections/sdk_tests/support/python_testing/models/test_case.py#L31-L42

     """Base class for all Python based test cases.
 
     This class provides a class factory that will dynamically declare a new sub-class
     based on the test-type the Python test is expressing.
 
-    The PythonTest will be stored as a class property that will be used at run-time 
+    The PythonTest will be stored as a class property that will be used at run-time
     in all instances of such subclass.
     """
 
     python_test: PythonTest
     python_test_version: str

Check failure on line 56 in /home/runner/work/certification-tool-backend/certification-tool-backend/test_collections/sdk_tests/support/python_testing/models/test_case.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/certification-tool-backend/certification-tool-backend/test_collections/sdk_tests/support/python_testing/models/test_case.py#L45-L56

         """Test Case level PICS. Read directly from parsed python test."""
         return cls.python_test.PICS
 
     @classmethod
     def default_test_parameters(cls) -> dict[str, Any]:
-        """Python test config dict, sometimes have a nested dict with type 
+        """Python test config dict, sometimes have a nested dict with type
         and default value.
         Only defaultValue is used in this case.
         """
         parameters = {}
         for param_name, value in cls.python_test.config.items():