fixed a bug

This commit is contained in:
2026-08-26 10:06:19 +08:00
parent f80da8a5f6
commit 14d9c56d34
2 changed files with 21 additions and 0 deletions

View File

@@ -455,6 +455,7 @@ def create_app(
raise HTTPException(status_code=404, detail="Dubbing share was not found.")
return {
"share_id": share["share_id"],
"video_hash": share["video_hash"],
"title": share["title"],
"created_at": share["created_at"],
"segments": [

View File

@@ -128,6 +128,26 @@ def test_catalog_and_range_streaming(tmp_path):
assert stream.content == b"video"
def test_get_dub_share_includes_video_hash(tmp_path):
client = make_client(tmp_path)
audio = ("dub.wav", make_wav(), "audio/wav")
created = client.post(
"/api/v1/dub-shares",
data={
"video_hash": VIDEO_HASH,
"title": "Shared lesson",
"segments": json.dumps([{"sentence_index": 0}]),
},
files={"files": audio},
)
response = client.get(f"/api/v1/dub-shares/{created.json()['share_id']}")
assert created.status_code == 201, created.text
assert response.status_code == 200, response.text
assert response.json()["video_hash"] == VIDEO_HASH
def test_assessment_client_key_is_enforced_when_configured(tmp_path):
client = make_client(tmp_path, client_api_key="tablet-key")
endpoint = f"/api/v1/videos/{VIDEO_HASH}/sentences/0/assessments"