Pytest Pythonqulis
Pytest Pythonqulis
def __init__(self,inventory=None):
if(inventory == None):
self.b_i=inventory
if not isinstance(inventory,dict):
raise TypeError("")
for i in inventory:
if not isinstance(i,str):
raise ValueError("")
if not isinstance(inventory[i], int) or (inventory[i]<0):
rasie ValueError("")
___________________________________________________________________________________
___________________________________________________________________________________
_____
___________________________________________________________________________________
________________________________________________________________________________
import sys
import os
sys.path.append(os.getcwd())
from proj.inventory import MobileInventory, InsufficientException
import pytest
# Import MobileInventory class and InsufficientException from the inventory module
using the expression from proj.inventory import MobileInventory,
InsufficientException.
# Import pytest using the expression import pytest.
# Use assert statement for assert, and to check. Ex: assert 1 == 1