fixed a bug
This commit is contained in:
@@ -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": [
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user