Esempio n. 1
0
 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)
Esempio n. 2
0
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
Esempio n. 3
0
 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)
Esempio n. 4
0
 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)
Esempio n. 5
0
 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()
Esempio n. 6
0
 def setUp(self):
     self.obj = MockObjectWithCommands(None)
     self.setup_for_object(self.obj)
     self.failobj = MUDObject(None)
     self.setup_for_object(self.failobj)
Esempio n. 7
0
 def test_speakTo_fails_with_nonTargettableObject(self):
     speakTo(self.actor, MUDObject(None), "foo")
     assert self.actor.delegate.received == [UnfoundObjectEvent()]
Esempio n. 8
0
def test_default_targetting_shorts():
    assert MUDObject(None).targetting_shorts == {}
Esempio n. 9
0
def test_deafness_turning_off():
    obj = MUDObject(None)
    obj.deaf = True
    deafOff(obj)
    assert not obj.deaf
Esempio n. 10
0
def test_hashability():
    s = set([MUDObject(None), MUDObject(None)])
    assert len(s) == 2
Esempio n. 11
0
def test_equality():
    m = MUDObject(None)
    assert m == m
    assert MUDObject(None) != m
Esempio n. 12
0
def test_register():
    obj = MUDObject(None)
    obj.addDelegate(DelegateHelper(obj))
Esempio n. 13
0
 def setUp(self):
     self.obj = MUDObject(None)
     self.obj.more_limiter = MoreLimiter(10)
     self.setup_for_object(self.obj)
Esempio n. 14
0
    def test_look_at_nowhere(self):
        lookAt(self.actor, MUDObject(None))

        assert self.actor.delegate.received == [UnfoundObjectEvent()]
Esempio n. 15
0
def test_default_deafness():
    assert not MUDObject(None).deaf
Esempio n. 16
0
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
Esempio n. 17
0
 def setUp(self):
     self.obj = MUDObject(None)
     self.setup_for_object(self.obj)
Esempio n. 18
0
 def setUp(self):
     self.obj = MUDObject(None)
     self.obj.addDelegate(DelegateHelper(self.obj))
Esempio n. 19
0
 def setUp(self):
     self.room = AnonyRoom()
     self.actor = MUDObject(self.room)
     self.setup_for_object(self.actor)
Esempio n. 20
0
def test_deafness_turning_on():
    obj = MUDObject(None)
    deafOn(obj)
    assert obj.deaf