Skip to content

Commit

Permalink
Update TC_CADMIN_1_22_24.py
Browse files Browse the repository at this point in the history
- Unnesting asserts from if statements
  • Loading branch information
j-ororke committed Nov 8, 2024
1 parent 32462f7 commit 7a032b9
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/python_testing/TC_CADMIN_1_22_24.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ async def test_TC_CADMIN_1_22(self):

self.step(4)
window_status = await self.get_window_status()
if window_status != Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen:
asserts.assert_equal(window_status, Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen,
asserts.assert_equal(window_status, Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen,
"Commissioning window is expected to be closed, but was found to be open")

self.step(5)
Expand All @@ -112,8 +111,7 @@ async def test_TC_CADMIN_1_22(self):

self.step(6)
window_status2 = await self.get_window_status()
if window_status2 != Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen:
asserts.assert_equal(await window_status, Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen, "Commissioning window is expected to be closed, but was found to be open")
asserts.assert_equal(await window_status2, Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen, "Commissioning window is expected to be closed, but was found to be open")

def pics_TC_CADMIN_1_24(self) -> list[str]:
return ["CADMIN.S"]
Expand Down Expand Up @@ -153,9 +151,8 @@ async def test_TC_CADMIN_1_24(self):
except asyncio.CancelledError:
window_status = await self.get_window_status()

if window_status != Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen:
asserts.assert_equal(window_status, Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen,
"Commissioning window is expected to be closed, but was found to be open")
asserts.assert_equal(window_status, Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen,
"Commissioning window is expected to be closed, but was found to be open")

self.step(5)
try:
Expand All @@ -171,8 +168,7 @@ async def test_TC_CADMIN_1_24(self):

self.step(6)
window_status2 = await self.get_window_status()
if window_status2 != Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen:
asserts.assert_equal(await window_status, Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen, "Commissioning window is expected to be closed, but was found to be open")
asserts.assert_equal(await window_status2, Clusters.AdministratorCommissioning.Enums.CommissioningWindowStatusEnum.kWindowNotOpen, "Commissioning window is expected to be closed, but was found to be open")


if __name__ == "__main__":
Expand Down

0 comments on commit 7a032b9

Please sign in to comment.