Ejemplo n.º 1
0
 def setUp(self):
     self.pencil = Item.create("Pencil", 0.40)
     self.ruler = Item.create("Ruler", 1.60)
     self.eraser = Item.create("Eraser", 0.20)
     self.pencilSet = Item.compose("Pencil Set", self.pencil,
                                   self.ruler, self.eraser)
     self.stdout = MockStdout()
Ejemplo n.º 2
0
 def test_compose(self):
     # TODO Implement me!
     # Do not forget to replace self.fail() statement with 
     # correct assertion method(s)!
     mechPencilCasing = Item.create("Mechanical Pencil Casing", 4.20)
     mechPencilLead = Item.create("Mechanical Pencil Lead", 0.10)
     mechPencil = Item.compose("Mechanical Pencil", mechPencilCasing,
                               mechPencilLead)
     self.assertEqual(mechPencil.name, "Mechanical Pencil")
     self.assertAlmostEqual(mechPencil.price, 4.30)
     self.assertTrue(mechPencil.composite)