def test_added_to_dm(): payload = load_payload("added_to_dm") expected = { "text": "Hello <users/123456789123456789123>! How are you?\n\nPlease, type *help* for more information about the commands available." } assert EventHandler(payload, Commands()).process() == expected
def test_added_to_room(): payload = load_payload("added_to_room") expected = { "text": "Hello people! Thanks for adding me to *Testing room*!\n\nPlease, type *help* for more information about the commands available." } assert EventHandler(payload, Commands()).process() == expected
def test_message_invalid(): payload = load_payload("message_invalid") expected = { "text": "Invalid command: *invalid*\n\nPlease, type *help* for more information about the commands available." } assert EventHandler(payload, Commands()).process() == expected
def test_message_empty(): payload = load_payload("message_empty") expected = { "text": "Commands available:\n\n" "*`help`*\nList commands available\n\n" 'HINT: If you need to specify multiple words for a parameter, use quotes (").' } assert EventHandler(payload, Commands()).process() == expected
def test_removed_from_dm(): payload = load_payload("removed_from_dm") EventHandler(payload, Commands()).process()
def test_message_simple_mention_on_room(): payload = load_payload("message_simple_mention_on_room") expected = {"text": "pong"} assert EventHandler(payload, Commands()).process() == expected