-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
43 lines (30 loc) · 724 Bytes
/
test.py
File metadata and controls
43 lines (30 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from api_util import delete_product, add_product
# URL of your Flask API endpoint
api_url = "http://127.0.0.1:5000/"
# Example product data
product_data = [
{
"name": "Vinegar",
"location_x": 1,
"location_y": 1,
"price": 300.0,
"expiration_date": "2026-12-31"
},
{
"name": "Chicken",
"location_x": 1,
"location_y": 2,
"price": 400.0,
"expiration_date": "2024-1-31"
},
{
"name": "Beef",
"location_x": 2,
"location_y": 1,
"price": 800.0,
"expiration_date": "2024-1-27"
}
]
for product in product_data:
add_product(api_url, product)
# delete_product(api_url, "test")