|
15 | 15 |
|
16 | 16 | from typing import Tuple, Union
|
17 | 17 |
|
18 |
| -from .errors import (TestStepError, TestStepGroupEndPointError, TestStepGroupResponseError, TestStepInvalidTypeError, |
19 |
| - TestStepKeyError, TestStepNodeIdAndGroupIdError, TestStepResponseVariableError, TestStepValueAndValuesError, |
20 |
| - TestStepVerificationStandaloneError, TestStepWaitResponseError) |
| 18 | +from .errors import (TestStepArgumentsValueError, TestStepError, TestStepGroupEndPointError, TestStepGroupResponseError, |
| 19 | + TestStepInvalidTypeError, TestStepKeyError, TestStepNodeIdAndGroupIdError, TestStepResponseVariableError, |
| 20 | + TestStepValueAndValuesError, TestStepVerificationStandaloneError, TestStepWaitResponseError) |
21 | 21 | from .fixes import add_yaml_support_for_scientific_notation_without_dot
|
22 | 22 |
|
23 | 23 | try:
|
@@ -120,6 +120,7 @@ def __check_test_step(self, config: dict, content):
|
120 | 120 | content)
|
121 | 121 | self.__rule_wait_should_not_expect_a_response(content)
|
122 | 122 | self.__rule_response_variable_should_exist_in_config(config, content)
|
| 123 | + self.__rule_argument_value_is_only_when_writing_attributes(content) |
123 | 124 |
|
124 | 125 | if 'arguments' in content:
|
125 | 126 | arguments = content.get('arguments')
|
@@ -260,3 +261,10 @@ def __rule_response_variable_should_exist_in_config(self, config, content):
|
260 | 261 | response = content.get('response')
|
261 | 262 | if isinstance(response, str) and response not in config:
|
262 | 263 | raise TestStepResponseVariableError(content)
|
| 264 | + |
| 265 | + def __rule_argument_value_is_only_when_writing_attributes(self, content): |
| 266 | + if 'arguments' in content: |
| 267 | + command = content.get('command') |
| 268 | + arguments = content.get('arguments') |
| 269 | + if 'value' in arguments and command != 'writeAttribute': |
| 270 | + raise TestStepArgumentsValueError(content) |
0 commit comments