Exemplo n.º 1
0
 def test_give_unit_of_type(self):
     warehouse = Warehouse()
     unit = Unit('company', 'model1')
     warehouse.add_unit(unit)
     given_unit = warehouse.give_unit_of_type(Unit)
     self.assertEqual(unit, given_unit)
     self.assertRaises(NoUnitsLeft, warehouse.give_unit_of_type, Unit)
Exemplo n.º 2
0
 def test_add(self):
     warehouse = Warehouse()
     unit = Unit('company', 'model1')
     warehouse.add_unit(unit)
     self.assertEqual(warehouse.units[Unit], [unit])