Add forgotten test case

This commit is contained in:
Kristóf Tóth 2019-09-04 18:18:03 +02:00
parent 613d906b44
commit 89b720c439

View File

@ -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): def test_ignores_unauthenticated(fsm_update_msg):
messages = [] messages = []
eh = FSMAwareEventHandler(DummyConnector()) eh = FSMAwareEventHandler(DummyConnector())
@ -49,6 +40,17 @@ def test_ignores_unauthenticated(fsm_update_msg):
assert not messages 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): def test_accepts_authenticated(key, fsm_update_msg):
messages = [] messages = []
eh = FSMAwareEventHandler(DummyConnector()) eh = FSMAwareEventHandler(DummyConnector())