summaryrefslogtreecommitdiffhomepage
path: root/packages/tui/sdk/client_test.go
diff options
context:
space:
mode:
authoradamdotdevin <[email protected]>2025-07-15 10:03:11 -0500
committeradamdotdevin <[email protected]>2025-07-15 10:03:11 -0500
commit6b98acb7be04ed04a56ea69b4cdbdcc5b4788a75 (patch)
tree9f9fa881050f60df1eb5f1e2cb9821e226b6e248 /packages/tui/sdk/client_test.go
parent2487b18f62d53b739dd09b797c2a57319224284d (diff)
downloadopencode-6b98acb7be04ed04a56ea69b4cdbdcc5b4788a75.tar.gz
opencode-6b98acb7be04ed04a56ea69b4cdbdcc5b4788a75.zip
chore: update stainless defs
Diffstat (limited to 'packages/tui/sdk/client_test.go')
-rw-r--r--packages/tui/sdk/client_test.go44
1 files changed, 8 insertions, 36 deletions
diff --git a/packages/tui/sdk/client_test.go b/packages/tui/sdk/client_test.go
index 62222a465..0f5b8205d 100644
--- a/packages/tui/sdk/client_test.go
+++ b/packages/tui/sdk/client_test.go
@@ -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")
}