From c0bbf43fa267737892a21b7ddc51df8da99415a6 Mon Sep 17 00:00:00 2001 From: LUCAS BECKER Date: Mon, 12 Feb 2024 22:48:08 -0300 Subject: [PATCH] fixed according review --- .../src/oven-operational-state-delegate.cpp | 4 ---- src/python_testing/TC_OPSTATE_1_1.py | 2 +- src/python_testing/TC_OPSTATE_2_1.py | 2 +- src/python_testing/TC_OPSTATE_2_2.py | 2 +- src/python_testing/TC_OPSTATE_2_3.py | 2 +- src/python_testing/TC_OPSTATE_2_4.py | 2 +- src/python_testing/TC_OPSTATE_2_5.py | 2 +- src/python_testing/TC_OVENOPSTATE_1_1.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_1.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_2.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_3.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_4.py | 2 +- src/python_testing/TC_OVENOPSTATE_2_5.py | 2 +- src/python_testing/TC_OpstateCommon.py | 12 +++++++----- 14 files changed, 19 insertions(+), 21 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/src/oven-operational-state-delegate.cpp b/examples/all-clusters-app/all-clusters-common/src/oven-operational-state-delegate.cpp index 9d07727b68f247..23f732bbe62d3a 100644 --- a/examples/all-clusters-app/all-clusters-common/src/oven-operational-state-delegate.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/oven-operational-state-delegate.cpp @@ -91,7 +91,6 @@ void OvenCavityOperationalStateDelegate::HandlePauseStateCallback(OperationalSta return; } - // placeholder implementation auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused)); if (error == CHIP_NO_ERROR) { @@ -114,7 +113,6 @@ void OvenCavityOperationalStateDelegate::HandleResumeStateCallback(OperationalSt return; } - // placeholder implementation auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)); if (error == CHIP_NO_ERROR) { @@ -137,7 +135,6 @@ void OvenCavityOperationalStateDelegate::HandleStartStateCallback(OperationalSta return; } - // placeholder implementation auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)); if (error == CHIP_NO_ERROR) { @@ -151,7 +148,6 @@ void OvenCavityOperationalStateDelegate::HandleStartStateCallback(OperationalSta void OvenCavityOperationalStateDelegate::HandleStopStateCallback(OperationalState::GenericOperationalError & err) { - // placeholder implementation auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)); if (error == CHIP_NO_ERROR) { diff --git a/src/python_testing/TC_OPSTATE_1_1.py b/src/python_testing/TC_OPSTATE_1_1.py index 1c5ff1f3f28781..49f88ec54e4c8b 100644 --- a/src/python_testing/TC_OPSTATE_1_1.py +++ b/src/python_testing/TC_OPSTATE_1_1.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Project CHIP Authors +# Copyright (c) 2024 Project CHIP Authors # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/python_testing/TC_OPSTATE_2_1.py b/src/python_testing/TC_OPSTATE_2_1.py index 3e0dc46c4ada23..14dc08b23863c6 100644 --- a/src/python_testing/TC_OPSTATE_2_1.py +++ b/src/python_testing/TC_OPSTATE_2_1.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Project CHIP Authors +# Copyright (c) 2024 Project CHIP Authors # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/python_testing/TC_OPSTATE_2_2.py b/src/python_testing/TC_OPSTATE_2_2.py index b490d71f9a28a3..e2d17926ceb2a1 100644 --- a/src/python_testing/TC_OPSTATE_2_2.py +++ b/src/python_testing/TC_OPSTATE_2_2.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Project CHIP Authors +# Copyright (c) 2024 Project CHIP Authors # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/python_testing/TC_OPSTATE_2_3.py b/src/python_testing/TC_OPSTATE_2_3.py index c7e30b4e814ab9..27a3dae081eb21 100644 --- a/src/python_testing/TC_OPSTATE_2_3.py +++ b/src/python_testing/TC_OPSTATE_2_3.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Project CHIP Authors +# Copyright (c) 2024 Project CHIP Authors # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/python_testing/TC_OPSTATE_2_4.py b/src/python_testing/TC_OPSTATE_2_4.py index 12ecf17e65387a..5e86ac8118ca20 100644 --- a/src/python_testing/TC_OPSTATE_2_4.py +++ b/src/python_testing/TC_OPSTATE_2_4.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Project CHIP Authors +# Copyright (c) 2024 Project CHIP Authors # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/python_testing/TC_OPSTATE_2_5.py b/src/python_testing/TC_OPSTATE_2_5.py index 134e3d4b0ed11a..fd34bebaeca423 100644 --- a/src/python_testing/TC_OPSTATE_2_5.py +++ b/src/python_testing/TC_OPSTATE_2_5.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Project CHIP Authors +# Copyright (c) 2024 Project CHIP Authors # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/python_testing/TC_OVENOPSTATE_1_1.py b/src/python_testing/TC_OVENOPSTATE_1_1.py index 0f0773522d47f6..3b724a826f39aa 100644 --- a/src/python_testing/TC_OVENOPSTATE_1_1.py +++ b/src/python_testing/TC_OVENOPSTATE_1_1.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Project CHIP Authors +# Copyright (c) 2024 Project CHIP Authors # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/python_testing/TC_OVENOPSTATE_2_1.py b/src/python_testing/TC_OVENOPSTATE_2_1.py index e0a401354b0e18..9c353d2a7a3b9e 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_1.py +++ b/src/python_testing/TC_OVENOPSTATE_2_1.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Project CHIP Authors +# Copyright (c) 2024 Project CHIP Authors # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/python_testing/TC_OVENOPSTATE_2_2.py b/src/python_testing/TC_OVENOPSTATE_2_2.py index d014e068a5e35d..cbad9741410950 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_2.py +++ b/src/python_testing/TC_OVENOPSTATE_2_2.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Project CHIP Authors +# Copyright (c) 2024 Project CHIP Authors # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/python_testing/TC_OVENOPSTATE_2_3.py b/src/python_testing/TC_OVENOPSTATE_2_3.py index d26f15abdec3ee..e3074cf0eef765 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_3.py +++ b/src/python_testing/TC_OVENOPSTATE_2_3.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Project CHIP Authors +# Copyright (c) 2024 Project CHIP Authors # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/python_testing/TC_OVENOPSTATE_2_4.py b/src/python_testing/TC_OVENOPSTATE_2_4.py index 5279e6ec70b796..41bacdeba7ae55 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_4.py +++ b/src/python_testing/TC_OVENOPSTATE_2_4.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Project CHIP Authors +# Copyright (c) 2024 Project CHIP Authors # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/python_testing/TC_OVENOPSTATE_2_5.py b/src/python_testing/TC_OVENOPSTATE_2_5.py index 1ff284f73906be..e8141bcb515717 100644 --- a/src/python_testing/TC_OVENOPSTATE_2_5.py +++ b/src/python_testing/TC_OVENOPSTATE_2_5.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Project CHIP Authors +# Copyright (c) 2024 Project CHIP Authors # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/python_testing/TC_OpstateCommon.py b/src/python_testing/TC_OpstateCommon.py index d3c1aabb1d8c86..c3a714d9cb0d51 100644 --- a/src/python_testing/TC_OpstateCommon.py +++ b/src/python_testing/TC_OpstateCommon.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Project CHIP Authors +# Copyright (c) 2024 Project CHIP Authors # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -624,14 +624,16 @@ async def TEST_TC_OPSTATE_BASE_2_2(self, endpoint=1): # STEP 9: TH reads from the DUT the CurrentPhase attribute self.step(9) - if self.pics_guard(self.check_pics("%s.S.A0001" % self.test_info.pics_code) and phase_list_len): + if self.pics_guard(self.check_pics("%s.S.A0001" % self.test_info.pics_code)): current_phase = await self.read_expect_success(endpoint=endpoint, attribute=attributes.CurrentPhase) if (phase_list == NullValue) or (not phase_list): - asserts.assert_true(current_phase == NullValue, "CurrentPhase(%s) should be null" % current_phase) + asserts.assert_equal(current_phase, NullValue, "CurrentPhase(%s) should be null" % current_phase) else: - asserts.assert_true(0 <= current_phase and current_phase < phase_list_len, - "CurrentPhase(%s) must be between 0 and %s" % (current_phase, (phase_list_len - 1))) + asserts.assert_less_equal(0, current_phase, + "CurrentPhase(%s) must be greater or equal than 0" % current_phase) + asserts.assert_less(current_phase < phase_list_len, + "CurrentPhase(%s) must be less then %s" % (current_phase, (phase_list_len - 1))) # STEP 10: TH waits for {PIXIT.WAITTIME.COUNTDOWN} self.step(10)