def testBagCreationAndAddingItems(): potion = ItemFactory(ItemList.Potion) b = Bag(100, [potion]) assert b.getCurrentWeight() == potion.getWeight() newPotion = ItemFactory(ItemList.Potion) b.addItem(newPotion) assert b.getCurrentWeight() == potion.getWeight() + newPotion.getWeight()
def testBagCreationAndFailureInAddingItems(): potion = ItemFactory(ItemList.Potion) b = Bag(16,[potion]) assert b.getCurrentWeight() == potion.getWeight() newPotion = ItemFactory(ItemList.Potion) assert b.addItem(newPotion)== False assert b.getCurrentWeight() == potion.getWeight() assert b.getAllItems()== [potion]