def test_add_products(): # delete product # variant timestamp o number casuale tarallo_session = Tarallo(t_url, t_token) data = { "brand": "testBrand", "model": "testModel", "variant": "testVariant", "features": { "psu-volt": 19 } } tarallo_session.delete_product(data.get("brand"), data.get("model"), data.get("variant")) p = ProductToUpload(data) assert tarallo_session.add_product(p) #raises ValidationError ??
def test_add_remove_products(): tarallo_session = Tarallo(t_url, t_token) data = { "brand": "testBrand", "model": "testModel", "variant": "testVariant", "features": {"psu-volt": 19} } deleted = tarallo_session.delete_product(data.get("brand"), data.get("model"), data.get("variant")) assert deleted or deleted is None p = ProductToUpload(data) assert tarallo_session.add_product(p)
def test_add_duplicate_products(): tarallo_session = Tarallo(t_url, t_token) data = { "brand": "testBrand", "model": "testModel", "variant": "testVariant", "features": {"psu-volt": 12} } p = ProductToUpload(data) # Remove and add deleted = tarallo_session.delete_product(data.get("brand"), data.get("model"), data.get("variant")) assert deleted or deleted is None assert tarallo_session.add_product(p) # This one fails tarallo_session.add_product(p)