def emoteToWrapper(actor, text, info): try: blob, text = emote_to_pattern.parseString(text) except ParseException: badSyntax() return try: target = get_from_rooms(blob, [actor.inventory, actor.room], info) except UnfoundError: unfoundObject() return text = text.replace('%', '%%') emoteTo(actor, target, 'You have emoted: ' + text, text, text)
def test_bad_syntax_with_argument(self): arg = "foo" badSyntax(self.obj, arg) assert self.obj.delegate.received == [BadSyntaxEvent(arg)]
def test_bad_syntax_without_argument(self): badSyntax(self.obj) assert self.obj.delegate.received == [BadSyntaxEvent(None)]