Exemple #1
0
def testItemUsed():
    potionItem = ItemFactory(ItemList.Potion)
    numberOfUsesInCreationTime = potionItem.getRemainingUses()
    potionItem.useItem()
    assert potionItem.isUsed() == True
    assert potionItem.getRemainingUses() == numberOfUsesInCreationTime - 1
    sleep(2)
    assert potionItem.getTimeRemaining() < 148
Exemple #2
0
def testItemNotUsed():
    swordItem = ItemFactory(ItemList.Sword)
    with pytest.raises(Exception):
        swordItem.getTimeLimit()
    assert swordItem.isUsed() == False