22"""
33End-to-end integration test:
44
5- 1. GET /APIs /stations → fetch the station list
5+ 1. GET /apis /stations → fetch the station list
662. Randomly select one station
7- 3. POST /APIs /run → submit a job for that station
8- 4. Poll GET /APIs /status until the job reaches COMPLETED (or FAILED)
7+ 3. POST /apis /run → submit a job for that station
8+ 4. Poll GET /apis /status until the job reaches COMPLETED (or FAILED)
995. GET /api/jobs/<job_id>/frames/<index> → fetch every produced frame
1010"""
1111
@@ -29,8 +29,8 @@ def main():
2929
3030 # ── 1. Fetch station list ────────────────────────────────────────
3131 print (f"\n { '=' * 60 } " )
32- print ("Step 1: GET /APIs /stations" )
33- resp = requests .get (f"{ BASE_URL } /APIs /stations" )
32+ print ("Step 1: GET /apis /stations" )
33+ resp = requests .get (f"{ BASE_URL } /apis /stations" )
3434 print (f" status: { resp .status_code } " )
3535 if resp .status_code != 200 :
3636 print (f" FAILED — { resp .text [:200 ]} " )
@@ -55,10 +55,10 @@ def main():
5555 }
5656
5757 print (f"\n { '=' * 60 } " )
58- print ("Step 3: POST /APIs /run" )
58+ print ("Step 3: POST /apis /run" )
5959 print (f" payload: { json .dumps (payload , indent = 2 )} " )
6060
61- resp = requests .post (f"{ BASE_URL } /APIs /run" , json = payload )
61+ resp = requests .post (f"{ BASE_URL } /apis /run" , json = payload )
6262 body = resp .json ()
6363 print (f" status: { resp .status_code } " )
6464 print (f" response: { json .dumps (body , indent = 2 )} " )
@@ -81,7 +81,7 @@ def main():
8181 time .sleep (5 )
8282 print (f"\n --- Poll #{ poll } ---" )
8383
84- resp = requests .get (f"{ BASE_URL } /APIs /status" , params = {"job_id" : job_id })
84+ resp = requests .get (f"{ BASE_URL } /apis /status" , params = {"job_id" : job_id })
8585 try :
8686 status_body = resp .json ()
8787 except requests .exceptions .JSONDecodeError :
@@ -108,7 +108,7 @@ def main():
108108 print (f"Step 5: Fetching { num_frames } frame(s) for job { job_id } " )
109109
110110 for index in range (num_frames ):
111- url = f"{ BASE_URL } /APIs /jobs/{ job_id } /frames/{ index } "
111+ url = f"{ BASE_URL } /apis /jobs/{ job_id } /frames/{ index } "
112112 print (f"\n GET { url } " )
113113 resp = requests .get (url )
114114 if resp .status_code == 200 :
0 commit comments