Skip to content

Commit 645a2d1

Browse files
committedJan 30, 2025
chore(internal): codegen related update (#3873)
1 parent a095e93 commit 645a2d1

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed
 

‎client_test.go

+21-21
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ func TestRetryAfter(t *testing.T) {
6767
},
6868
}),
6969
)
70-
res, err := client.Zones.New(context.Background(), zones.ZoneNewParams{
70+
_, err := client.Zones.New(context.Background(), zones.ZoneNewParams{
7171
Account: cloudflare.F(zones.ZoneNewParamsAccount{
7272
ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
7373
}),
7474
Name: cloudflare.F("example.com"),
7575
Type: cloudflare.F(zones.TypeFull),
7676
})
77-
if err == nil || res != nil {
78-
t.Error("Expected there to be a cancel error and for the response to be nil")
77+
if err == nil {
78+
t.Error("Expected there to be a cancel error")
7979
}
8080

8181
attempts := len(retryCountHeaders)
@@ -107,15 +107,15 @@ func TestDeleteRetryCountHeader(t *testing.T) {
107107
}),
108108
option.WithHeaderDel("X-Stainless-Retry-Count"),
109109
)
110-
res, err := client.Zones.New(context.Background(), zones.ZoneNewParams{
110+
_, err := client.Zones.New(context.Background(), zones.ZoneNewParams{
111111
Account: cloudflare.F(zones.ZoneNewParamsAccount{
112112
ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
113113
}),
114114
Name: cloudflare.F("example.com"),
115115
Type: cloudflare.F(zones.TypeFull),
116116
})
117-
if err == nil || res != nil {
118-
t.Error("Expected there to be a cancel error and for the response to be nil")
117+
if err == nil {
118+
t.Error("Expected there to be a cancel error")
119119
}
120120

121121
expectedRetryCountHeaders := []string{"", "", ""}
@@ -142,15 +142,15 @@ func TestOverwriteRetryCountHeader(t *testing.T) {
142142
}),
143143
option.WithHeader("X-Stainless-Retry-Count", "42"),
144144
)
145-
res, err := client.Zones.New(context.Background(), zones.ZoneNewParams{
145+
_, err := client.Zones.New(context.Background(), zones.ZoneNewParams{
146146
Account: cloudflare.F(zones.ZoneNewParamsAccount{
147147
ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
148148
}),
149149
Name: cloudflare.F("example.com"),
150150
Type: cloudflare.F(zones.TypeFull),
151151
})
152-
if err == nil || res != nil {
153-
t.Error("Expected there to be a cancel error and for the response to be nil")
152+
if err == nil {
153+
t.Error("Expected there to be a cancel error")
154154
}
155155

156156
expectedRetryCountHeaders := []string{"42", "42", "42"}
@@ -176,15 +176,15 @@ func TestRetryAfterMs(t *testing.T) {
176176
},
177177
}),
178178
)
179-
res, err := client.Zones.New(context.Background(), zones.ZoneNewParams{
179+
_, err := client.Zones.New(context.Background(), zones.ZoneNewParams{
180180
Account: cloudflare.F(zones.ZoneNewParamsAccount{
181181
ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
182182
}),
183183
Name: cloudflare.F("example.com"),
184184
Type: cloudflare.F(zones.TypeFull),
185185
})
186-
if err == nil || res != nil {
187-
t.Error("Expected there to be a cancel error and for the response to be nil")
186+
if err == nil {
187+
t.Error("Expected there to be a cancel error")
188188
}
189189
if want := 3; attempts != want {
190190
t.Errorf("Expected %d attempts, got %d", want, attempts)
@@ -204,15 +204,15 @@ func TestContextCancel(t *testing.T) {
204204
)
205205
cancelCtx, cancel := context.WithCancel(context.Background())
206206
cancel()
207-
res, err := client.Zones.New(cancelCtx, zones.ZoneNewParams{
207+
_, err := client.Zones.New(cancelCtx, zones.ZoneNewParams{
208208
Account: cloudflare.F(zones.ZoneNewParamsAccount{
209209
ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
210210
}),
211211
Name: cloudflare.F("example.com"),
212212
Type: cloudflare.F(zones.TypeFull),
213213
})
214-
if err == nil || res != nil {
215-
t.Error("Expected there to be a cancel error and for the response to be nil")
214+
if err == nil {
215+
t.Error("Expected there to be a cancel error")
216216
}
217217
}
218218

@@ -229,15 +229,15 @@ func TestContextCancelDelay(t *testing.T) {
229229
)
230230
cancelCtx, cancel := context.WithTimeout(context.Background(), 2*time.Millisecond)
231231
defer cancel()
232-
res, err := client.Zones.New(cancelCtx, zones.ZoneNewParams{
232+
_, err := client.Zones.New(cancelCtx, zones.ZoneNewParams{
233233
Account: cloudflare.F(zones.ZoneNewParamsAccount{
234234
ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
235235
}),
236236
Name: cloudflare.F("example.com"),
237237
Type: cloudflare.F(zones.TypeFull),
238238
})
239-
if err == nil || res != nil {
240-
t.Error("expected there to be a cancel error and for the response to be nil")
239+
if err == nil {
240+
t.Error("expected there to be a cancel error")
241241
}
242242
}
243243

@@ -260,15 +260,15 @@ func TestContextDeadline(t *testing.T) {
260260
},
261261
}),
262262
)
263-
res, err := client.Zones.New(deadlineCtx, zones.ZoneNewParams{
263+
_, err := client.Zones.New(deadlineCtx, zones.ZoneNewParams{
264264
Account: cloudflare.F(zones.ZoneNewParamsAccount{
265265
ID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
266266
}),
267267
Name: cloudflare.F("example.com"),
268268
Type: cloudflare.F(zones.TypeFull),
269269
})
270-
if err == nil || res != nil {
271-
t.Error("expected there to be a deadline error and for the response to be nil")
270+
if err == nil {
271+
t.Error("expected there to be a deadline error")
272272
}
273273
close(testDone)
274274
}()

0 commit comments

Comments
 (0)