MCPcopy Create free account
hub / github.com/52funny/pikpakcli / TestPikPakWithContext

Function TestPikPakWithContext

internal/api/file_test.go:34–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestPikPakWithContext(t *testing.T) {
35 base := NewPikPak("user", "pass")
36 ctx, cancel := context.WithCancel(context.Background())
37 defer cancel()
38
39 derived := base.WithContext(ctx)
40
41 assert.NotNil(t, derived)
42 assert.NotSame(t, &base, derived)
43 assert.Equal(t, ctx, derived.requestContext())
44 assert.NotEqual(t, ctx, base.requestContext())
45}

Callers

nothing calls this directly

Calls 3

WithContextMethod · 0.95
requestContextMethod · 0.95
NewPikPakFunction · 0.85

Tested by

no test coverage detected