def setUp(self): self.room = AnonyRoom() self.actor = MUDObject(self.room) self.target = TargettableObject("", set(['rabbit']), self.room) self.onlooker = MUDObject(self.room) self.other_room_target = TargettableObject('', set(), None) self.setup_for_object(self.actor) self.setup_for_object(self.target) self.setup_for_object(self.onlooker) self.info = LineInfo(instigator=self.actor)
def test_at_least_calls_the_base___Xstate__(): obj = MUDObject(None) s = pickle.dumps(obj) try: o = pickle.loads(s) except RuntimeError: #well, we called it... pass else: assert False, "got %r instead" % o
def setUp(self): self.room = AnonyRoom() self.actor = MUDObject(self.room) self.target = TargettableObject("a killer rabbit", set(['bunny', 'killer', 'rabbit']), self.room) self.setup_for_object(self.actor) self.setup_for_object(self.target) self.info = MockInfo(self.actor)
def setUp(self): self.room = AnonyRoom() self.target = TargettableObject('a killer rabbit', set(['killer', 'rabbit']), self.room) self.actor = MUDObject(self.room) self.setup_for_object(self.actor) self.setup_for_object(self.target) self.goodblob, = object_pattern.parseString('killer rabbit') self.badblob, = object_pattern.parseString("bogus bunny") self.info = MockInfo(self.actor)
def setUp(self): self.room = AnonyRoom() self.target = TargettableObject( "a killer rabbit", set(['killer', 'rabbit', 'bunny', 'fluffy']), self.room) self.setup_for_object(self.target) self.actor = MUDObject(self.room) self.setup_for_object(self.actor) targetSet(self.actor, "bob", self.target) self.info = LineInfoMockup(self.actor) self.bogusroom = AnonyRoom()
def setUp(self): self.obj = MockObjectWithCommands(None) self.setup_for_object(self.obj) self.failobj = MUDObject(None) self.setup_for_object(self.failobj)
def test_speakTo_fails_with_nonTargettableObject(self): speakTo(self.actor, MUDObject(None), "foo") assert self.actor.delegate.received == [UnfoundObjectEvent()]
def test_default_targetting_shorts(): assert MUDObject(None).targetting_shorts == {}
def test_deafness_turning_off(): obj = MUDObject(None) obj.deaf = True deafOff(obj) assert not obj.deaf
def test_hashability(): s = set([MUDObject(None), MUDObject(None)]) assert len(s) == 2
def test_equality(): m = MUDObject(None) assert m == m assert MUDObject(None) != m
def test_register(): obj = MUDObject(None) obj.addDelegate(DelegateHelper(obj))
def setUp(self): self.obj = MUDObject(None) self.obj.more_limiter = MoreLimiter(10) self.setup_for_object(self.obj)
def test_look_at_nowhere(self): lookAt(self.actor, MUDObject(None)) assert self.actor.delegate.received == [UnfoundObjectEvent()]
def test_default_deafness(): assert not MUDObject(None).deaf
def test_adding(): r = Room('A blank room', 'Nothing to see here, move along.') obj = MUDObject(None) r.add(obj) assert obj in r.contents
def setUp(self): self.obj = MUDObject(None) self.setup_for_object(self.obj)
def setUp(self): self.obj = MUDObject(None) self.obj.addDelegate(DelegateHelper(self.obj))
def setUp(self): self.room = AnonyRoom() self.actor = MUDObject(self.room) self.setup_for_object(self.actor)
def test_deafness_turning_on(): obj = MUDObject(None) deafOn(obj) assert obj.deaf