Add python tests model classes #10
Annotations
67 errors and 1 warning
/home/runner/work/certification-tool-backend/certification-tool-backend/app/tests/python_tests/test_python_folder.py#L52
_ = python_folder.python_file_paths()
path_glob.assert_called_once_with("*.py")
path_glob.reset_mock()
pattern = "TC_*"
- python_test_folder = PythonTestFolder(test_python_path, filename_pattern=pattern)
+ python_test_folder = PythonTestFolder(
+ test_python_path, filename_pattern=pattern
+ )
_ = python_test_folder.python_file_paths()
path_glob.assert_called_once_with(f"{pattern}.py")
|
/home/runner/work/certification-tool-backend/certification-tool-backend/app/tests/python_tests/test_python_parser.py#L67
new=mock.mock_open(read_data=sample_invalid_python_file_content),
):
try:
parse_python_test(file_path)
except PythonParserException as e:
- assert "Test Case file does not have methods desc_file or steps_file" == str(e)
+ assert (
+ "Test Case file does not have methods desc_file or steps_file" == str(e)
+ )
def test_python_file_parser() -> None:
file_path = Path("/test/file.py")
|
/home/runner/work/certification-tool-backend/certification-tool-backend/app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L1
-
- #
- # Copyright (c) 2023 Project CHIP Authors
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
+#
+# Copyright (c) 2023 Project CHIP Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
# Copyright (c) 2021 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
|
/home/runner/work/certification-tool-backend/certification-tool-backend/app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L31
"""
This is just a sample test case that should come from SDK.
It should not compile or run.
"""
+
+
class TC_Sample(MatterBaseTest):
-
def desc_TC_Sample(self) -> str:
return "Sample TC Description"
def steps_TC_Sample(self) -> list[TestStep]:
steps = [
|
/home/runner/work/certification-tool-backend/certification-tool-backend/app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L46
]
return steps
@async_test_body
async def test_steps_TC_Sample(self):
- print("Test execution")
+ print("Test execution")
|
app/tests/python_tests/test_python_parser.py#L19
Module "test_collections.sdk_tests.support.python_testing.models.python_test_parser" has no attribute "PythonParserException" [attr-defined]
|
/home/runner/work/certification-tool-backend/certification-tool-backend/app/tests/python_tests/test_python_test_declarations.py#L17
from test_collections.sdk_tests.support.python_testing.models.test_declarations import (
PythonCaseDeclaration,
PythonSuiteDeclaration,
)
-from test_collections.sdk_tests.support.python_testing.models.test_suite import SuiteType
+from test_collections.sdk_tests.support.python_testing.models.test_suite import (
+ SuiteType,
+)
from test_collections.sdk_tests.support.python_testing.models.python_test_models import (
PythonTest,
)
|
app/tests/python_tests/test_python_parser.py#L19
Module "test_collections.sdk_tests.support.python_testing.models.python_test_parser" has no attribute "parse_python_test" [attr-defined]
|
app/tests/python_tests/test_python_folder.py#L19
Line too long (89 > 88 characters) (E501)
|
/home/runner/work/certification-tool-backend/certification-tool-backend/app/tests/python_tests/test_python_test_suite.py#L46
def test_python_test_suite_python_version() -> None:
"""Test that test suite python version is set correctly in class factory."""
python_test_version = "best_version"
# Create a subclass of PythonTestSuite
suite_class: Type[PythonTestSuite] = PythonTestSuite.class_factory(
- suite_type=SuiteType.AUTOMATED, name="SomeSuite", python_test_version=python_test_version
+ suite_type=SuiteType.AUTOMATED,
+ name="SomeSuite",
+ python_test_version=python_test_version,
)
assert suite_class.python_test_version == python_test_version
|
app/tests/python_tests/test_python_folder.py#L32
Line too long (91 > 88 characters) (E501)
|
test_collections/sdk_tests/support/python_testing/sdk_python_test_tests.py#L21
Module "test_collections.sdk_tests.support.python_testing.models.python_test_parser" has no attribute "PythonParserException" [attr-defined]
|
/home/runner/work/certification-tool-backend/certification-tool-backend/app/tests/python_tests/test_python_test_suite.py#L94
"""Test that both PythonTestSuite.setup and ChipToolSuite.setup are called when
PythonChipToolsSuite.setup is called. We do this as PythonChipToolsSuite inherits from
both PythonTestSuite and ChipToolSuite."""
suite_class: Type[PythonTestSuite] = PythonTestSuite.class_factory(
- suite_type=SuiteType.AUTOMATED, name="SomeSuite", python_test_version="Some version"
+ suite_type=SuiteType.AUTOMATED,
+ name="SomeSuite",
+ python_test_version="Some version",
)
suite_instance = suite_class(TestSuiteExecution())
with mock.patch(
|
app/tests/python_tests/test_python_folder.py#L57
Line too long (89 > 88 characters) (E501)
|
/home/runner/work/certification-tool-backend/certification-tool-backend/app/tests/python_tests/test_python_test_case.py#L46
path: Optional[Path] = None,
) -> PythonTest:
return PythonTest(
name=name,
PICS=PICS,
- config=config,
+ config=config,
steps=steps,
type=type,
path=path,
)
|
test_collections/sdk_tests/support/python_testing/sdk_python_test_tests.py#L21
Module "test_collections.sdk_tests.support.python_testing.models.python_test_parser" has no attribute "parse_python_test" [attr-defined]
|
app/tests/python_tests/test_python_parser.py#L19
Line too long (89 > 88 characters) (E501)
|
/home/runner/work/certification-tool-backend/certification-tool-backend/app/tests/python_tests/test_python_test_case.py#L243
)
instance = case_class(TestCaseExecution())
# Assert all steps from python test are added
assert len(instance.test_steps) >= no_steps
- steps_from_python = [s for s in instance.test_steps if s.name == test_step.label]
+ steps_from_python = [
+ s for s in instance.test_steps if s.name == test_step.label
+ ]
assert len(steps_from_python) == no_steps
@pytest.mark.asyncio
async def test_setup_super_error_handling() -> None:
|
app/tests/python_tests/test_python_parser.py#L66
Line too long (91 > 88 characters) (E501)
|
/home/runner/work/certification-tool-backend/certification-tool-backend/test_collections/sdk_tests/__init__.py#L12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from .support.yaml_tests import sdk_collection, custom_collection
+
# TODO The Python test support implementation is ongoing.
-# Uncomment line below when the implementation is done.
-#from .support.python_testing import sdk_python_collection
+# Uncomment line below when the implementation is done.
+# from .support.python_testing import sdk_python_collection
|
app/tests/python_tests/test_python_parser.py#L72
Line too long (91 > 88 characters) (E501)
|
/home/runner/work/certification-tool-backend/certification-tool-backend/test_collections/sdk_tests/support/yaml_tests/models/yaml_test_folder.py#L17
from test_collections.sdk_tests.support.paths import SDK_CHECKOUT_PATH
UNKNOWN_version = "Unknown"
VERSION_FILE_FILENAME = ".version"
-
class YamlTestFolder:
"""Representing a folder with Test YAML files.
|
app/tests/python_tests/test_python_parser.py#L81
Line too long (91 > 88 characters) (E501)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L2
Indentation is not a multiple of 4 (comment) (E114)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L2
Unexpected indentation (comment) (E116)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L3
Indentation is not a multiple of 4 (comment) (E114)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L3
Unexpected indentation (comment) (E116)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L4
Indentation is not a multiple of 4 (comment) (E114)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L4
Unexpected indentation (comment) (E116)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L5
Indentation is not a multiple of 4 (comment) (E114)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L5
Unexpected indentation (comment) (E116)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L6
Indentation is not a multiple of 4 (comment) (E114)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L6
Unexpected indentation (comment) (E116)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L7
Indentation is not a multiple of 4 (comment) (E114)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L7
Unexpected indentation (comment) (E116)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L8
Indentation is not a multiple of 4 (comment) (E114)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L8
Unexpected indentation (comment) (E116)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L9
Indentation is not a multiple of 4 (comment) (E114)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L9
Unexpected indentation (comment) (E116)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L10
Indentation is not a multiple of 4 (comment) (E114)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L10
Unexpected indentation (comment) (E116)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L11
Indentation is not a multiple of 4 (comment) (E114)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L11
Unexpected indentation (comment) (E116)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L12
Indentation is not a multiple of 4 (comment) (E114)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L12
Unexpected indentation (comment) (E116)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L13
Indentation is not a multiple of 4 (comment) (E114)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L13
Unexpected indentation (comment) (E116)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L14
Indentation is not a multiple of 4 (comment) (E114)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L14
Unexpected indentation (comment) (E116)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L15
Indentation is not a multiple of 4 (comment) (E114)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L15
Unexpected indentation (comment) (E116)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L33
Trailing whitespace (W291)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L34
Trailing whitespace (W291)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L36
Expected 2 blank lines, found 0 (E302)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L36
Undefined name 'MatterBaseTest' (F821)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L41
Undefined name 'TestStep' (F821)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L43
Undefined name 'TestStep' (F821)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L44
Undefined name 'TestStep' (F821)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L45
Undefined name 'TestStep' (F821)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L49
Undefined name 'async_test_body' (F821)
|
app/tests/python_tests/test_python_script/UnitTest_TC_ACL_1_1_Automated.py#L51
No newline at end of file (W292)
|
app/tests/python_tests/test_python_test_case.py#L30
Line too long (89 > 88 characters) (E501)
|
app/tests/python_tests/test_python_test_case.py#L51
Trailing whitespace (W291)
|
app/tests/python_tests/test_python_test_case.py#L82
Line too long (91 > 88 characters) (E501)
|
app/tests/python_tests/test_python_test_case.py#L105
Line too long (89 > 88 characters) (E501)
|
app/tests/python_tests/test_python_test_case.py#L136
Line too long (90 > 88 characters) (E501)
|
Run linters
Process completed with exit code 1.
|
Run linters
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/setup-python@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|