From 89b720c439b17b56a49566801bd94c99e707cecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Wed, 4 Sep 2019 18:18:03 +0200 Subject: [PATCH] Add forgotten test case --- .../test_fsm_aware_event_handler.py | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tfw/internals/event_handling/test_event_handling/test_fsm_aware_event_handler.py b/tfw/internals/event_handling/test_event_handling/test_fsm_aware_event_handler.py index 2c37874..c08b8d0 100644 --- a/tfw/internals/event_handling/test_event_handling/test_fsm_aware_event_handler.py +++ b/tfw/internals/event_handling/test_event_handling/test_fsm_aware_event_handler.py @@ -31,15 +31,6 @@ def fsm_update_msg(): } -def test_ignores_other_keys(): - messages = [] - eh = FSMAwareEventHandler(DummyConnector()) - eh.handle_event = lambda msg, _: messages.append(msg) - - simulate_event(eh, {"key": "not.fsm.update"}) - assert not messages - - def test_ignores_unauthenticated(fsm_update_msg): messages = [] eh = FSMAwareEventHandler(DummyConnector()) @@ -49,6 +40,17 @@ def test_ignores_unauthenticated(fsm_update_msg): assert not messages +def test_ignores_other_keys(key): + messages = [] + eh = FSMAwareEventHandler(DummyConnector()) + eh.handle_event = lambda msg, _: messages.append(msg) + + test_msg = {"key": "not.fsm.update"} + sign_message(key, test_msg) + simulate_event(eh, test_msg) + assert not messages + + def test_accepts_authenticated(key, fsm_update_msg): messages = [] eh = FSMAwareEventHandler(DummyConnector())