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
def testItemNotUsed(): swordItem = ItemFactory(ItemList.Sword) with pytest.raises(Exception): swordItem.getTimeLimit() assert swordItem.isUsed() == False