MCPcopy Create free account
hub / github.com/docker/cli / TestGpusOptAll

Function TestGpusOptAll

opts/gpus_test.go:11–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestGpusOptAll(t *testing.T) {
12 for _, testcase := range []string{
13 "all",
14 "-1",
15 "count=all",
16 "count=-1",
17 } {
18 var gpus GpuOpts
19 assert.Check(t, gpus.Set(testcase))
20 gpuReqs := gpus.Value()
21 assert.Assert(t, is.Len(gpuReqs, 1))
22 assert.Check(t, is.DeepEqual(gpuReqs[0], container.DeviceRequest{
23 Count: -1,
24 Capabilities: [][]string{{"gpu"}},
25 Options: map[string]string{},
26 }))
27 }
28}
29
30func TestGpusOptInvalidCount(t *testing.T) {
31 var gpus GpuOpts

Callers

nothing calls this directly

Calls 3

SetMethod · 0.95
ValueMethod · 0.95
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…