def testItemConsumed(): swordItem = ItemFactory(ItemList.Sword) numberOfUsesInCreationTime = swordItem.getRemainingUses() for _ in range(numberOfUsesInCreationTime): assert swordItem.isconsumed() == False swordItem.useItem() assert swordItem.isconsumed() == True
def testCoin(): smallCoin = ItemFactory(ItemList.Coin) assert smallCoin.getRemainingUses() == 1 smallCoin.useItem() assert smallCoin.isconsumed() == True