cvpfus Codex commited on
Commit
ae41a8e
·
1 Parent(s): 4c29f47

Execute demo script sample payloads

Browse files

Co-authored-by: Codex <codex@openai.com>

Files changed (1) hide show
  1. scripts/verify.py +14 -0
scripts/verify.py CHANGED
@@ -297,6 +297,20 @@ def verify_routes() -> None:
297
  speech_check["sample_body"]["voice"] == app.READER_SETTINGS["default_voice"],
298
  "Speech demo check should use the default reader voice",
299
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300
 
301
  audit = client.get("/api/accessibility-audit")
302
  assert_true(audit.status_code == 200, "Accessibility audit route should return 200")
 
297
  speech_check["sample_body"]["voice"] == app.READER_SETTINGS["default_voice"],
298
  "Speech demo check should use the default reader voice",
299
  )
300
+ reader_sample = client.post(reader_check["path"], json=reader_check["sample_body"])
301
+ assert_true(reader_sample.status_code == 200, "Reader-brain sample payload should be executable")
302
+ reader_sample_payload = reader_sample.json()
303
+ assert_true(reader_sample_payload["ok"], "Reader-brain sample payload should return ok")
304
+ assert_true("narration" in reader_sample_payload, "Reader-brain sample payload should return narration")
305
+
306
+ speech_sample = client.post(speech_check["path"], json=speech_check["sample_body"])
307
+ assert_true(speech_sample.status_code == 200, "Speech sample payload should be executable")
308
+ speech_sample_payload = speech_sample.json()
309
+ assert_true(speech_sample_payload["ok"], "Speech sample payload should return ok")
310
+ assert_true(
311
+ speech_sample_payload["audio_url"].startswith("/outputs/"),
312
+ "Speech sample payload should return an output audio URL",
313
+ )
314
 
315
  audit = client.get("/api/accessibility-audit")
316
  assert_true(audit.status_code == 200, "Accessibility audit route should return 200")