Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
dmulcahey committed Aug 22, 2024
1 parent ec2466d commit 5d62314
Showing 1 changed file with 9 additions and 21 deletions.
30 changes: 9 additions & 21 deletions tests/test_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,44 +736,32 @@ async def test_global_updater_guards(
) -> None:
"""Test global updater guards."""

assert (
already_registered = (
"listener already registered with global updater - nothing to register"
not in caplog.text
)
assert (
"listener not registered with global updater - nothing to remove"
not in caplog.text
)
not_registered = "listener not registered with global updater - nothing to remove"

assert already_registered not in caplog.text
assert not_registered not in caplog.text

def listener():
pass

zha_gateway.global_updater.register_update_listener(listener)

assert (
"listener already registered with global updater - nothing to register"
not in caplog.text
)
assert already_registered not in caplog.text

zha_gateway.global_updater.register_update_listener(listener)

assert (
"listener already registered with global updater - nothing to register"
in caplog.text
)
assert already_registered in caplog.text

zha_gateway.global_updater.remove_update_listener(listener)

assert (
"listener not registered with global updater - nothing to remove"
not in caplog.text
)
assert not_registered not in caplog.text

zha_gateway.global_updater.remove_update_listener(listener)

assert (
"listener not registered with global updater - nothing to remove" in caplog.text
)
assert not_registered in caplog.text


async def test_gateway_handle_message(
Expand Down

0 comments on commit 5d62314

Please sign in to comment.