def test_auto_summon(): q = queue.Queue() ec = events.EventClassifier() prompt.Prompt(ec) clerbot = cler.ClerBot(q, ec, u"Дарсу") init_group(clerbot, group_setup) for s, mode in group_headers: if mode == "NEAR": clerbot.mudfilter(s) break assert clerbot.mode() == "NEAR" for g_member in group1_near: clerbot.mudfilter(g_member) ec.mudfilter(p1) assert q.get_nowait().command() == u"cast призыв Алиант" ec.mudfilter("Вы произнесли магические слова 'призыв'...") ec.mudfilter("Алиант неожиданно появился.") ec.mudfilter(p1) assert q.get_nowait().command() == u"cast призыв Цушка" ec.mudfilter("Вы произнесли магические слова 'призыв'...") assert q.empty() return q, clerbot
def test_unstone(): q = queue.Queue() ec = events.EventClassifier() prompt.Prompt(ec) clerbot = cler.ClerBot(q, ec, u"Дарсу") init_group(clerbot, group_setup) for s, mode in group_headers: if mode == "HEALTH": clerbot.mudfilter(s) break assert clerbot.mode() == "HEALTH" clerbot.mudfilter(color2_test.replace("^[", chr(27))) ec.mudfilter(p1) assert q.get_nowait().command() == u"cast живое.прикосновение Шыгос" init_group(clerbot, stone_setup) for s, mode in group_headers: if mode == "HEALTH": clerbot.mudfilter(s) break assert clerbot.mode() == "HEALTH" for s in stone_test: clerbot.mudfilter(s.replace("^[", chr(27))) ec.mudfilter(p1) assert q.get_nowait().command() == u"cast живое.прикосновение Китаст"
def test_undrain(): q = queue.Queue() ec = events.EventClassifier() prompt.Prompt(ec) clerbot = cler.ClerBot(q, ec, u"Дарсу") init_group(ec, group_setup) for s, mode in group_headers: if mode == "HEALTH": clerbot.mudfilter(s) break assert clerbot.mode() == "HEALTH" for g_member in group1_health: clerbot.mudfilter(g_member) ec.mudfilter(p1) assert q.get_nowait().command() == u"cast слово.силы Шыгос"
def test_stand_up(monkeypatch): q = queue.Queue() ec = events.EventClassifier() prompt.Prompt(ec) clerbot = cler.ClerBot(q, ec, u"Дарсу") def cmd(command, **kwargs): assert command == "stand" monkeypatch.setattr(exported, "lyntin_command", cmd) init_group(clerbot, group_setup) for s, mode in group_headers: if mode == "HEALTH": clerbot.mudfilter(s) break assert clerbot.mode() == "HEALTH" for g_member in group1_stand: clerbot.mudfilter(g_member) ec.mudfilter(p1)