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