MCPcopy
hub / github.com/moby/moby / TestDiskUsageWithOptions

Function TestDiskUsageWithOptions

client/system_disk_usage_test.go:51–131  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

49}
50
51func TestDiskUsageWithOptions(t *testing.T) {
52 const expectedURL = "/system/df"
53
54 tests := []struct {
55 options DiskUsageOptions
56 expectedQuery string
57 }{
58 {
59 options: DiskUsageOptions{
60 Containers: true,
61 },
62 expectedQuery: "type=container",
63 },
64 {
65 options: DiskUsageOptions{
66 Images: true,
67 },
68 expectedQuery: "type=image",
69 },
70 {
71 options: DiskUsageOptions{
72 Volumes: true,
73 },
74 expectedQuery: "type=volume",
75 },
76 {
77 options: DiskUsageOptions{
78 BuildCache: true,
79 },
80 expectedQuery: "type=build-cache",
81 },
82 {
83 options: DiskUsageOptions{
84 Containers: true,
85 Images: true,
86 },
87 expectedQuery: "type=container&type=image",
88 },
89 {
90 options: DiskUsageOptions{
91 Containers: true,
92 Images: true,
93 Volumes: true,
94 BuildCache: true,
95 },
96 expectedQuery: "type=container&type=image&type=volume&type=build-cache",
97 },
98 {
99 options: DiskUsageOptions{
100 Containers: true,
101 Verbose: true,
102 },
103 expectedQuery: "type=container&verbose=1",
104 },
105 {
106 options: DiskUsageOptions{
107 Containers: true,
108 Images: true,

Callers

nothing calls this directly

Calls 7

WithMockClientFunction · 0.85
assertRequestWithQueryFunction · 0.85
mockJSONResponseFunction · 0.85
NewFunction · 0.70
RunMethod · 0.65
DiskUsageMethod · 0.65
ContextMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…