def testCanNotAddIfFull(self): t1 = mc2.MudObject() t2 = mc2.MudObject() self.ml.append(t1) assert self.ml.append(t2) == False
w_fist = mc.Weapon("main hand") w_fist.shortDescription = "your two fists" w_fist.name = "unarmed" w_fist.dp = 2 w_fist.keywords = ['Unarmed'] w_fist.verb = english.Verb("punch") cretin = mc.Mobile() cretin.name = "Cretin" cretin.hp = 10 cretin.shortDescription = "ugly man" cretin.keywords = ['self', 'me'] cretin.addGearSlot(mc.ItemSlot("main hand", "all", w_fist)) desk = mc.MudObject("Wooden Desk", "shabby wooden desk") desk.keywords = ['desk'] backpack = mc.Bag("Backpack", "small orange backpack") backpack.maxSize = 2 backpack.keywords = ['orange backpack', 'bag', 'backpack'] fang = mc.Weapon("main hand", "Fang", 4) fang.shortDescription = "small knife with a faint glow" fang.keywords = ['knife', 'dagger'] fang.verb = english.Verb("stab") r_bedroom = mc.Room("Bedroom") r_bedroom.longDescription = "Your bedroom." r_apartment = mc.Room("An apartment") r_apartment.longDescription = "Your room, a desk sits in the corner."
def testCanTestIsIn(self): t = mc2.MudObject() self.ml.append(t) assert (t in self.ml) == True
def testCanTestIsNotIn(self): t = mc2.MudObject() assert (t in self.ml) == False
def testCanNotRemoveIfNotIn(self): t = mc2.MudObject() assert self.ml.remove(t) == False
def testCanRemoveIfIn(self): t = mc2.MudObject() self.ml.append(t) assert self.ml.remove(t) == True
def testCanAdd(self): t = mc2.MudObject() assert self.ml.append(t) == True
def setUp(self): self.root = mc2.PermissionHandler() self.t = mc2.MudObject(owner=self.root)
def testCanNotAddIfFull(self): t1 = mc2.MudObject() t2 = mc2.MudObject() self.r.append(t1) r = self.r.append(t2) assert r == False