chore: update stainless defs

This commit is contained in:
adamdotdevin
2025-07-15 10:03:11 -05:00
parent 2487b18f62
commit 6b98acb7be
8 changed files with 101 additions and 121 deletions

View File

@@ -38,7 +38,7 @@ func TestUserAgentHeader(t *testing.T) {
},
}),
)
client.Event.ListStreaming(context.Background())
client.Session.List(context.Background())
if userAgent != fmt.Sprintf("Opencode/Go %s", internal.PackageVersion) {
t.Errorf("Expected User-Agent to be correct, but got: %#v", userAgent)
}
@@ -61,11 +61,7 @@ func TestRetryAfter(t *testing.T) {
},
}),
)
stream := client.Event.ListStreaming(context.Background())
for stream.Next() {
// ...
}
err := stream.Err()
_, err := client.Session.List(context.Background())
if err == nil {
t.Error("Expected there to be a cancel error")
}
@@ -99,11 +95,7 @@ func TestDeleteRetryCountHeader(t *testing.T) {
}),
option.WithHeaderDel("X-Stainless-Retry-Count"),
)
stream := client.Event.ListStreaming(context.Background())
for stream.Next() {
// ...
}
err := stream.Err()
_, err := client.Session.List(context.Background())
if err == nil {
t.Error("Expected there to be a cancel error")
}
@@ -132,11 +124,7 @@ func TestOverwriteRetryCountHeader(t *testing.T) {
}),
option.WithHeader("X-Stainless-Retry-Count", "42"),
)
stream := client.Event.ListStreaming(context.Background())
for stream.Next() {
// ...
}
err := stream.Err()
_, err := client.Session.List(context.Background())
if err == nil {
t.Error("Expected there to be a cancel error")
}
@@ -164,11 +152,7 @@ func TestRetryAfterMs(t *testing.T) {
},
}),
)
stream := client.Event.ListStreaming(context.Background())
for stream.Next() {
// ...
}
err := stream.Err()
_, err := client.Session.List(context.Background())
if err == nil {
t.Error("Expected there to be a cancel error")
}
@@ -190,11 +174,7 @@ func TestContextCancel(t *testing.T) {
)
cancelCtx, cancel := context.WithCancel(context.Background())
cancel()
stream := client.Event.ListStreaming(cancelCtx)
for stream.Next() {
// ...
}
err := stream.Err()
_, err := client.Session.List(cancelCtx)
if err == nil {
t.Error("Expected there to be a cancel error")
}
@@ -213,11 +193,7 @@ func TestContextCancelDelay(t *testing.T) {
)
cancelCtx, cancel := context.WithTimeout(context.Background(), 2*time.Millisecond)
defer cancel()
stream := client.Event.ListStreaming(cancelCtx)
for stream.Next() {
// ...
}
err := stream.Err()
_, err := client.Session.List(cancelCtx)
if err == nil {
t.Error("expected there to be a cancel error")
}
@@ -242,11 +218,7 @@ func TestContextDeadline(t *testing.T) {
},
}),
)
stream := client.Event.ListStreaming(deadlineCtx)
for stream.Next() {
// ...
}
err := stream.Err()
_, err := client.Session.List(deadlineCtx)
if err == nil {
t.Error("expected there to be a deadline error")
}