many updates
This commit is contained in:
28
FitnessSync/scratch/test_save.py
Normal file
28
FitnessSync/scratch/test_save.py
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
import requests
|
||||
import json
|
||||
|
||||
URL = "http://localhost:8000/api/segments/save_custom"
|
||||
|
||||
def test_save_custom():
|
||||
payload = {
|
||||
"name": "Test Segment Discovered",
|
||||
"description": "Created via API test",
|
||||
"activity_type": "cycling",
|
||||
"points": [
|
||||
[151.2093, -33.8688, 10],
|
||||
[151.2100, -33.8690, 15],
|
||||
[151.2110, -33.8700, 20]
|
||||
]
|
||||
}
|
||||
|
||||
try:
|
||||
res = requests.post(URL, json=payload)
|
||||
print(f"Status: {res.status_code}")
|
||||
print(f"Response: {res.text}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_save_custom()
|
||||
Reference in New Issue
Block a user