Skip to content

Commit c4aceb7

Browse files
s-gattichulspro
s-gatti
authored andcommitted
Fix failing tests
Signed-off-by: Sathvik K Gatti <[email protected]> Signed-off-by: Suyambulingam Rathinasamy Muthupandi <[email protected]> Signed-off-by: Charles Kim <[email protected]>
1 parent 30009f6 commit c4aceb7

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

test_collections/matter/sdk_tests/support/tests/yaml_tests/test_yaml_parser.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ def test_test_type_all_disabled_steps() -> None:
103103
disabled_step = MatterTestStep(label="Disabled Test Step", disabled=True)
104104
five_disabled_steps_test = yaml_test_instance(tests=[disabled_step] * 5)
105105

106-
type = _test_type(five_disabled_steps_test)
106+
type, _ = _test_type(five_disabled_steps_test)
107107
assert type == MatterTestType.MANUAL
108108

109109
# simulated in path overrides test type to simulated
110110
five_disabled_steps_test.path = Path("TC_XX_Simulated.yaml")
111-
type = _test_type(five_disabled_steps_test)
111+
type, _ = _test_type(five_disabled_steps_test)
112112
assert type == MatterTestType.SIMULATED
113113

114114

@@ -117,25 +117,25 @@ def test_test_type_some_disabled_steps() -> None:
117117
enabled_step = MatterTestStep(label="Enabled Test Step", disabled=False)
118118
test = yaml_test_instance(tests=[disabled_step, enabled_step])
119119

120-
type = _test_type(test)
120+
type, _ = _test_type(test)
121121
assert type == MatterTestType.AUTOMATED
122122

123123
# simulated in path overrides test type to simulated
124124
test.path = Path("TC_XX_Simulated.yaml")
125-
type = _test_type(test)
125+
type, _ = _test_type(test)
126126
assert type == MatterTestType.SIMULATED
127127

128128

129129
def test_test_type_all_enabled_steps_no_prompts() -> None:
130130
enabled_step = MatterTestStep(label="Enabled Test Step")
131131
five_enabled_steps_test = yaml_test_instance(tests=[enabled_step] * 5)
132132

133-
type = _test_type(five_enabled_steps_test)
133+
type, _ = _test_type(five_enabled_steps_test)
134134
assert type == MatterTestType.AUTOMATED
135135

136136
# simulated in path overrides test type to simulated
137137
five_enabled_steps_test.path = Path("TC_XX_Simulated.yaml")
138-
type = _test_type(five_enabled_steps_test)
138+
type, _ = _test_type(five_enabled_steps_test)
139139
assert type == MatterTestType.SIMULATED
140140

141141

@@ -144,10 +144,10 @@ def test_test_type_all_enabled_steps_some_prompts() -> None:
144144
prompt_step = MatterTestStep(label="Prompt Test Step", command="UserPrompt")
145145
test = yaml_test_instance(tests=[enabled_step, prompt_step])
146146

147-
type = _test_type(test)
147+
type, _ = _test_type(test)
148148
assert type == MatterTestType.SEMI_AUTOMATED
149149

150150
# simulated in path overrides test type to simulated
151151
test.path = Path("TC_XX_Simulated.yaml")
152-
type = _test_type(test)
152+
type, _ = _test_type(test)
153153
assert type == MatterTestType.SIMULATED

test_collections/matter/sdk_tests/support/yaml_tests/models/yaml_test_parser.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class YamlParserException(Exception):
2828
"""Raised when an error occurs during the parser of yaml file."""
2929

3030

31-
def _get_types(test: YamlTest) -> tuple[MatterTestType, SuiteType]:
32-
"""Determine the type of a test based on the parsed yaml.
31+
def _test_type(test: YamlTest) -> tuple[MatterTestType, SuiteType]:
32+
"""Determine the type of a test and test suite based on the parsed yaml.
3333
3434
This is mainly determined by the number of disabled test steps.
3535
@@ -89,7 +89,7 @@ def parse_yaml_test(path: Path) -> YamlTest:
8989
yaml_str = file.read()
9090
test = YamlTest.parse_raw(yaml_str, proto="yaml")
9191
test.path = path
92-
test_type, suite_type = _get_types(test)
92+
test_type, suite_type = _test_type(test)
9393
test.type = test_type
9494
test.suite_type = suite_type
9595
except ValidationError as e:

0 commit comments

Comments
 (0)