def test_fuck_off_empty_args(update, context): with patch.object(update.message, "reply_text") as m: context.args = [] fuck_off.cmd_faas(update, context) m.assert_called_with("Use: /f**k <who> - To send someone f**k off")
def test_cmd_fuck_off_username(update, context): with patch.object(update.message, "reply_text") as m: context.args = ["@rondi"] fuck_off.cmd_faas(update, context) m.assert_called_with("http://foaas.com/off/@rondi/Alan")
def test_cmd_fuck_off_multi_args(update, context): with patch.object(update.message, "reply_text") as m: context.args = ["the", "rules"] fuck_off.cmd_faas(update, context) m.assert_called_with("http://foaas.com/off/the%20rules/Alan")
def test_cmd_fuck_off_normal_arg(bot, update): with patch.object(update.message, "reply_text") as m: fuck_off.cmd_faas(bot, update, args=["Rondi"]) m.assert_called_with("http://foaas.com/off/Rondi/Alan")