def test_invoke_returns_bully_response_with_action(fake_get_user_name_by_id): fake_get_user_name_by_id.return_value = "bob" cc_bot = CCBot() action = "marklar" cc_bot.deny_response = ['bully is trying to {action}'] text, attachments = cc_bot.invoke("ccbot " + action, cc_bot.bully_id) assert text == ('bully is trying to %(action)s' % {'action': action})
def test_invoke_returns_bully_response_if_user_is_bully_and_action_not_found( fake_get_user_name_by_id): fake_get_user_name_by_id.return_value = "bob" cc_bot = CCBot() cc_bot.deny_response = ['bully response'] text, attachments = cc_bot.invoke("ccbot boo", cc_bot.bully_id) assert text == "bully response"
def test_invoke_returns_bully_response_with_bully_name( fake_get_user_name_by_id): fake_get_user_name_by_id.return_value = "bob" cc_bot = CCBot() cc_bot.deny_response = ['bully is {name}'] text, attachments = cc_bot.invoke("ccbot boo", cc_bot.bully_id) bully_name = cc_bot.bully_name assert text == 'bully is ' + bully_name