def test_in_stock_not_sure(): with open("test_resources/test_page3.html") as tp3: soup = BeautifulSoup(tp3, 'html.parser') assert lambda_function.in_stock(soup, 'stock-button', 'Add product to cart', 'Product out of stock') == False
def test_in_stock_no_button_class(): assert lambda_function.in_stock(BeautifulSoup(''), 'class', 'instock', 'outofstock') == False
def test_in_stock_product_in_stock(): with open("test_resources/test_page1.html") as tp1: soup = BeautifulSoup(tp1, 'html.parser') assert lambda_function.in_stock(soup, 'stock-button', 'Add product to cart', 'Product out of stock') == True
def test_in_stock_no_soup(): assert lambda_function.in_stock(None, 'class', 'instock', 'outofstock') == False