@@ -86,22 +86,22 @@ func TestDetectClientTypeRecognizesVideoGenerationsPath(t *testing.T) {
8686 adapter := NewAdapter ()
8787
8888 // Submit: POST with a JSON body carrying the model.
89- submitBody := []byte (`{"model":"doubao-seedance-2-0-260128 ","prompt":"a cat runs"}` )
90- for _ , path := range []string {"/v1/video/generations" , "/video/generations" } {
89+ submitBody := []byte (`{"model":"video-test-model ","prompt":"a cat runs"}` )
90+ for _ , path := range []string {"/v1/video/generations" , "/video/generations" , "/v1/videos" , "/videos" } {
9191 req := httptest .NewRequest ("POST" , path , strings .NewReader (string (submitBody )))
9292 if got := adapter .DetectClientType (req , submitBody ); got != domain .ClientTypeVideo {
9393 t .Fatalf ("DetectClientType(POST %s) = %s, want %s" , path , got , domain .ClientTypeVideo )
9494 }
9595 if got , ok := adapter .Match (req ); ! ok || got != domain .ClientTypeVideo {
9696 t .Fatalf ("Match(POST %s) = (%s, %v), want (%s, true)" , path , got , ok , domain .ClientTypeVideo )
9797 }
98- if got := adapter .ExtractModel (req , submitBody , domain .ClientTypeVideo ); got != "doubao-seedance-2-0-260128 " {
99- t .Fatalf ("ExtractModel(%s) = %q, want the seedance model" , path , got )
98+ if got := adapter .ExtractModel (req , submitBody , domain .ClientTypeVideo ); got != "video-test-model " {
99+ t .Fatalf ("ExtractModel(%s) = %q, want video-test- model" , path , got )
100100 }
101101 }
102102
103103 // Poll: GET /{task_id} with no body — classified by path, model is empty.
104- for _ , path := range []string {"/v1/video/generations/task_abc123" , "/video/generations/task_abc123" } {
104+ for _ , path := range []string {"/v1/video/generations/task_abc123" , "/video/generations/task_abc123" , "/v1/videos/task_abc123" , "/videos/task_abc123" } {
105105 req := httptest .NewRequest ("GET" , path , nil )
106106 if got := adapter .DetectClientType (req , nil ); got != domain .ClientTypeVideo {
107107 t .Fatalf ("DetectClientType(GET %s) = %s, want %s" , path , got , domain .ClientTypeVideo )
@@ -118,7 +118,7 @@ func TestDetectClientTypeRecognizesVideoGenerationsPath(t *testing.T) {
118118// Only the poll (collection path + a non-empty task id) may be a GET; the bare
119119// submit endpoints stay POST-only, so the method gate must not treat them as polls.
120120func TestIsVideoPollPath (t * testing.T ) {
121- polls := []string {"/v1/video/generations/task_abc123" , "/video/generations/task_abc123" }
121+ polls := []string {"/v1/video/generations/task_abc123" , "/video/generations/task_abc123" , "/v1/videos/task_abc123" , "/videos/task_abc123" }
122122 for _ , p := range polls {
123123 if ! IsVideoPollPath (p ) {
124124 t .Fatalf ("IsVideoPollPath(%s) = false, want true" , p )
@@ -127,6 +127,8 @@ func TestIsVideoPollPath(t *testing.T) {
127127 notPolls := []string {
128128 "/v1/video/generations" , "/video/generations" ,
129129 "/v1/video/generations/" , "/video/generations/" , // trailing slash, no task id
130+ "/v1/videos" , "/videos" ,
131+ "/v1/videos/" , "/videos/" , // trailing slash, no task id
130132 "/v1/chat/completions" ,
131133 }
132134 for _ , p := range notPolls {
0 commit comments