Skip to content

Commit

Permalink
Resolving Linting issue in TC_RVCOPSTATE_2_1:
Browse files Browse the repository at this point in the history
- Had to remove "test_step" variable that was attempting to be called in wait_for_user_input() as it was not being defined earlier in the test module.
  • Loading branch information
j-ororke committed Jul 11, 2024
1 parent 084a115 commit 3c2ba60
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/python_testing/TC_RVCOPSTATE_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,28 +176,28 @@ async def test_TC_RVCOPSTATE_2_1(self):
if self.check_pics("RVCOPSTATE.S.M.ST_STOPPED"):
self.print_step("6a", "Manually put the device in the stopped state")
if not self.is_ci:
self.wait_for_user_input(prompt_msg=f"{test_step}, and Press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"Press Enter when done.\n")
await self.read_and_validate_opstate(step="6b", expected_state=Clusters.OperationalState.Enums.OperationalStateEnum.kStopped)
if self.check_pics("RVCOPSTATE.S.M.ST_RUNNING"):
self.print_step("6c", "Manually put the device in the running state")
if self.is_ci:
await self.send_run_change_to_mode_cmd(1)
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_opstate(step="6d", expected_state=Clusters.OperationalState.Enums.OperationalStateEnum.kRunning)
if self.check_pics("RVCOPSTATE.S.M.ST_PAUSED"):
self.print_step("6e", "Manually put the device in the paused state")
if self.is_ci:
await self.send_pause_cmd()
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_opstate(step="6f", expected_state=Clusters.OperationalState.Enums.OperationalStateEnum.kPaused)
if self.check_pics("RVCOPSTATE.S.M.ST_ERROR"):
self.print_step("6g", "Manually put the device in the error state")
if self.is_ci:
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "UnableToStartOrResume"}')
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_opstate(step="6h", expected_state=Clusters.OperationalState.Enums.OperationalStateEnum.kError)
if self.check_pics("RVCOPSTATE.S.M.ST_SEEKING_CHARGER"):
self.print_step("6i", "Manually put the device in the seeking charger state")
Expand All @@ -206,21 +206,21 @@ async def test_TC_RVCOPSTATE_2_1(self):
await self.send_run_change_to_mode_cmd(1)
await self.send_run_change_to_mode_cmd(0)
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_opstate(step="6j", expected_state=Clusters.RvcOperationalState.Enums.OperationalStateEnum.kSeekingCharger)
if self.check_pics("RVCOPSTATE.S.M.ST_CHARGING"):
self.print_step("6k", "Manually put the device in the charging state")
if self.is_ci:
self.write_to_app_pipe('{"Name": "ChargerFound"}')
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_opstate(step="6l", expected_state=Clusters.RvcOperationalState.Enums.OperationalStateEnum.kCharging)
if self.check_pics("RVCOPSTATE.S.M.ST_DOCKED"):
self.print_step("6m", "Manually put the device in the docked state")
if self.is_ci:
self.write_to_app_pipe('{"Name": "Charged"}')
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_opstate(step="6n", expected_state=Clusters.RvcOperationalState.Enums.OperationalStateEnum.kDocked)

if oprtnlerror_attr_id in attribute_list:
Expand All @@ -244,84 +244,84 @@ async def test_TC_RVCOPSTATE_2_1(self):
if self.check_pics("RVCOPSTATE.S.M.ERR_NO_ERROR"):
self.print_step("7a", "Manually put the device in the no error state")
if not self.is_ci:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_operror(step="7b", expected_error=Clusters.OperationalState.Enums.ErrorStateEnum.kNoError)
if self.check_pics("RVCOPSTATE.S.M.ERR_UNABLE_TO_START_OR_RESUME"):
self.print_step("7c", "Manually put the device in the unable to start or resume error state")
if self.is_ci:
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "UnableToStartOrResume"}')
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_operror(step="7d", expected_error=Clusters.OperationalState.Enums.ErrorStateEnum.kUnableToStartOrResume)
if self.check_pics("RVCOPSTATE.S.M.ERR_UNABLE_TO_COMPLETE_OPERATION"):
self.print_step("7e", "Manually put the device in the unable to complete operation error state")
if self.is_ci:
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "UnableToCompleteOperation"}')
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_operror(step="7f", expected_error=Clusters.OperationalState.Enums.ErrorStateEnum.kUnableToCompleteOperation)
if self.check_pics("RVCOPSTATE.S.M.ERR_COMMAND_INVALID_IN_STATE"):
self.print_step("7g", "Manually put the device in the command invalid error state")
if self.is_ci:
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "CommandInvalidInState"}')
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_operror(step="7h", expected_error=Clusters.OperationalState.Enums.ErrorStateEnum.kCommandInvalidInState)
if self.check_pics("RVCOPSTATE.S.M.ERR_FAILED_TO_FIND_CHARGING_DOCK"):
self.print_step("7i", "Manually put the device in the failed to find dock error state")
if self.is_ci:
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "FailedToFindChargingDock"}')
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_operror(step="7j", expected_error=Clusters.RvcOperationalState.Enums.ErrorStateEnum.kFailedToFindChargingDock)
if self.check_pics("RVCOPSTATE.S.M.ERR_STUCK"):
self.print_step("7k", "Manually put the device in the stuck error state")
if self.is_ci:
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "Stuck"}')
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_operror(step="7l", expected_error=Clusters.RvcOperationalState.Enums.ErrorStateEnum.kStuck)
if self.check_pics("RVCOPSTATE.S.M.ERR_DUST_BIN_MISSING"):
self.print_step("7m", "Manually put the device in the dust bin missing error state")
if self.is_ci:
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "DustBinMissing"}')
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_operror(step="7n", expected_error=Clusters.RvcOperationalState.Enums.ErrorStateEnum.kDustBinMissing)
if self.check_pics("RVCOPSTATE.S.M.ERR_DUST_BIN_FULL"):
self.print_step("7o", "Manually put the device in the dust bin full error state")
if self.is_ci:
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "DustBinFull"}')
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_operror(step="7p", expected_error=Clusters.RvcOperationalState.Enums.ErrorStateEnum.kDustBinFull)
if self.check_pics("RVCOPSTATE.S.M.ERR_WATER_TANK_EMPTY"):
self.print_step("7q", "Manually put the device in the water tank empty error state")
if self.is_ci:
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "WaterTankEmpty"}')
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and pressEnter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_operror(step="7r", expected_error=Clusters.RvcOperationalState.Enums.ErrorStateEnum.kWaterTankEmpty)
if self.check_pics("RVCOPSTATE.S.M.ERR_WATER_TANK_MISSING"):
self.print_step("7s", "Manually put the device in the water tank missing error state")
if self.is_ci:
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "WaterTankMissing"}')
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_operror(step="7t", expected_error=Clusters.RvcOperationalState.Enums.ErrorStateEnum.kWaterTankMissing)
if self.check_pics("RVCOPSTATE.S.M.ERR_WATER_TANK_LID_OPEN"):
self.print_step("7u", "Manually put the device in the water tank lid open error state")
if self.is_ci:
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "WaterTankLidOpen"}')
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_operror(step="7v", expected_error=Clusters.RvcOperationalState.Enums.ErrorStateEnum.kWaterTankLidOpen)
if self.check_pics("RVCOPSTATE.S.M.ERR_MOP_CLEANING_PAD_MISSING"):
self.print_step("7w", "Manually put the device in the mop cleaning pad missing error state")
if self.is_ci:
self.write_to_app_pipe('{"Name": "ErrorEvent", "Error": "MopCleaningPadMissing"}')
else:
self.wait_for_user_input(prompt_msg=f"{test_step}, and press Enter when done.\n")
self.wait_for_user_input(prompt_msg=f"press Enter when done.\n")
await self.read_and_validate_operror(step="7x", expected_error=Clusters.RvcOperationalState.Enums.ErrorStateEnum.kMopCleaningPadMissing)


Expand Down

0 comments on commit 3c2ba60

Please sign in to comment.