Exemplo n.º 1
0
 def evaluate(self, unittest):
     if len(self.__original_list) != len(self.__expected_list):
         print("Different sized code blocks")
         print(self.__original_list)
         print(self.__expected_list)
         return
     if self.__original_code_block != "":
         self.__original_list.append(self.__original_code_block)
         self.__original_code_block = ""
     if self.__expected_code_block != "":
         self.__expected_list.append(self.__expected_code_block)
         self.__expected_code_block = ""
     for i in range(len(self.__original_list)):
         o = rm.run(self.__original_list[i])
         e = self.__expected_list[i]
         result = unittest.assertEquals(o, e)
Exemplo n.º 2
0
    def test_destroy(self):
        r = self.world.getByID(1)
        b = BerinObject(self.world, r, oshort="doomed object")
        b.moveTo(self.o)
        world.destroy(self.o)

        unittest.assertEquals(r.getItem(self.o.getAttribute("oshort")), None)

        unittest.assertEquals(self.world.getByID(self.o.getID()), None)
        unittest.assertEquals(self.world.getByID(b.getID()), None)

        unittest.assertFalse(b in self.o.contents)
        unittest.assertFalse(o in self.o.contents)
Exemplo n.º 3
0
    def test_store(self):
        r = self.world.getByID(1)
        o = BerinObject(self.world, r, oshort="umquloaxatl")  # no confusion
        i = o.getID()

        o.setAttribute("id", 51421)
        self.world.store(o)

        unittest.assertEquals(r.getItem("umquloaxatl"), None)

        o = self.world.retrieve(i)
        unittest.assertEquals(o.getID(), i)

        o.pushItem(o)

        self.world.store(o)
        o = self.world.retrieve(i)
        unittest.assertEquals(o, o.getItem("umquloaxatl"))

        self.o = o
Exemplo n.º 4
0
 def test_lot(self):
     lot = Lot(1)
     unittest.assertEquals(lot.name, lots[1]['name'])