Files
ai/video/vod_api_test.go
zeekay 1a1fa37452 3d: the endpoints that answered without a model are gone, and a VOD url is never an error's text
GET /v1/3d/:id answered "completed" with a made-up cdn.hanzo.ai url and
fixed counts, /content returned the literal HANZO_3D_SPLAT_DATA_STREAM,
and the create called this gateway with no key. A fake success is worse
than a 404: the three routes, their handlers and the client go. 3D comes
back through a real model.

GetVideoCoverUrl and GetVideoFileUrl returned an error's text as the url,
which the video row stored and never read again. An unread url is now no
url, so the next read asks again.
2026-10-16 22:51:55 -07:00

33 lines
1.1 KiB
Go

// Copyright 2023-2025 Hanzo AI Inc. All Rights Reserved.
// Portions Copyright 2023 The OpenAgent Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package video
import "testing"
// A url that could not be read is no url: never the error's text, which a row
// would store as its address and never ask for again.
func TestAnUnreadURLIsNoURL(t *testing.T) {
prev := VodClient
VodClient = nil
t.Cleanup(func() { VodClient = prev })
if got := GetVideoCoverUrl("v1"); got != "" {
t.Errorf("cover url = %q, want none", got)
}
if got := GetVideoFileUrl("v1"); got != "" {
t.Errorf("file url = %q, want none", got)
}
}