def test_build_minimal(): bot = bot_builder.build() assert hasattr(bot, "reply")
from botinterface.bot_rivescript import BotRivescript from botinterface.preprocessor import MessagePreprocessor import bot_builder from messagelog.message import Message # set_up bot = bot_builder.build() USERID = "localuser" def setglobal(): # enter global topic: msg = Message(USERID, "set global") bot.reply(msg) def setemotional(): msg = Message(USERID, "discuss emotional") bot.reply(msg) def resetToEmotional(): setglobal() setemotional() def test_enter_emotional(): setglobal() messages = ["discuss emotional"]
from botinterface.bot_rivescript import BotRivescript from botinterface.preprocessor import MessagePreprocessor import bot_builder from messagelog.message import Message # set_up bot = bot_builder.build() USERID = "localuser" def senddummymessage(): content = "dummy" msg = Message(USERID, content) bot.reply(msg) def setglobal(): msg = Message(USERID, "set global") actual = bot.reply(msg) expected = "Topic set to global" assert expected == actual def resetfamily(): setglobal() msg = Message(USERID, "discuss family") reply = bot.reply(msg) assert "family" in reply def test_enter_family_topic(): setglobal() # perform: