added better data
parent
451fe6b2fa
commit
9811340337
|
|
@ -71,8 +71,8 @@ def main():
|
|||
cart_db.clear_cart(ex_user_id)
|
||||
|
||||
# user id, product id, name, quantity, price
|
||||
cart_db.add_to_cart(ex_user_id, 1, "Product 1", 2, 10.0)
|
||||
cart_db.add_to_cart(ex_user_id, 2, "Product 2", 5, 20.0)
|
||||
cart_db.add_to_cart(ex_user_id, 1, "Unsichtbare Tinte", 2, 3.0)
|
||||
cart_db.add_to_cart(ex_user_id, 3, "Geräuschloser Wecker", 5, 15.0)
|
||||
print(f"Cart items for user {ex_user_id}:", cart_db.fetch_cart_items(ex_user_id))
|
||||
|
||||
# user id, product id, quantity
|
||||
|
|
|
|||
|
|
@ -68,9 +68,9 @@ def main():
|
|||
product_db.delete_product(product[0])
|
||||
|
||||
# name, price, quantity
|
||||
products = [("Apel", 2.5, 5),
|
||||
("Banana", 1.5, 10),
|
||||
("Orange", 3.2, 7)]
|
||||
products = [("Unsichtbare Tinte", 2.5, 5),
|
||||
("Luftdichter Sieb", 7.5, 10),
|
||||
("Geräuschloser Wecker", 15.0, 7)]
|
||||
|
||||
for product in products:
|
||||
product_db.add_product(product)
|
||||
|
|
@ -80,22 +80,6 @@ def main():
|
|||
for product in products:
|
||||
print(product)
|
||||
|
||||
# name, price, quantity
|
||||
product_data = ("Orange", 3.0, 5)
|
||||
product_db.update_product(3, product_data)
|
||||
|
||||
product = product_db.get_product_by_id(1)
|
||||
print("Updated product:")
|
||||
print(product)
|
||||
|
||||
product_db.delete_product(2)
|
||||
print("Product deleted")
|
||||
|
||||
products = product_db.get_all_products()
|
||||
print("All products:")
|
||||
for product in products:
|
||||
print(product)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
@ -68,17 +68,14 @@ def main():
|
|||
for user in user_db.get_all_users():
|
||||
user_db.delete_user(user[0])
|
||||
|
||||
users = [("Michael", "michael@mail.com"),
|
||||
("Klöara", "klara@mail.com"),
|
||||
("Arman", "arman@mail.com")]
|
||||
|
||||
users = [("Reiner", "Reiner.Zufall@mail.com"),
|
||||
("Frank N.", "Frank.N.Stein@mail.com"),
|
||||
("Rainer", "Rainer.Wahnsinn@mail.com"),
|
||||
("Clara ", "Clara.Fall@mail.com")]
|
||||
|
||||
# add users
|
||||
for user in users:
|
||||
user_id = user_db.add_user(user)
|
||||
|
||||
user = user_db.get_user_by_id(1)
|
||||
print(f"Retrieved user: {user}")
|
||||
|
||||
user_db.update_user(2, ("Klara", "klara@mail.com"))
|
||||
user_db.add_user(user)
|
||||
|
||||
users = user_db.get_all_users()
|
||||
for user in users:
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue