Skip to content

Commit

Permalink
fixed according review
Browse files Browse the repository at this point in the history
  • Loading branch information
beckerzito committed Feb 13, 2024
1 parent 640d33a commit c0bbf43
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_OPSTATE_1_1.py
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_OPSTATE_2_1.py
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_OPSTATE_2_2.py
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_OPSTATE_2_3.py
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_OPSTATE_2_4.py
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_OPSTATE_2_5.py
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_OVENOPSTATE_1_1.py
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_OVENOPSTATE_2_1.py
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_OVENOPSTATE_2_2.py
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_OVENOPSTATE_2_3.py
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_OVENOPSTATE_2_4.py
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/TC_OVENOPSTATE_2_5.py
Original file line number Diff line number Diff line change
@@ -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");
Expand Down
12 changes: 7 additions & 5 deletions src/python_testing/TC_OpstateCommon.py
Original file line number Diff line number Diff line change
@@ -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");
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c0bbf43

Please sign in to comment.