MCPcopy
hub / github.com/moby/moby / TestImageList

Function TestImageList

client/image_list_test.go:34–122  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

32}
33
34func TestImageList(t *testing.T) {
35 const expectedURL = "/images/json"
36
37 tests := []struct {
38 doc string
39 options ImageListOptions
40 expectedQueryParams map[string]string
41 }{
42 {
43 doc: "no options",
44 options: ImageListOptions{},
45 expectedQueryParams: map[string]string{
46 "all": "",
47 "filter": "",
48 "filters": "",
49 },
50 },
51 {
52 doc: "label filters and dangling",
53 options: ImageListOptions{
54 Filters: make(Filters).
55 Add("label", "label1").
56 Add("label", "label2").
57 Add("dangling", "true"),
58 },
59 expectedQueryParams: map[string]string{
60 "all": "",
61 "filter": "",
62 "filters": `{"dangling":{"true":true},"label":{"label1":true,"label2":true}}`,
63 },
64 },
65 {
66 doc: "label filters no dangling",
67 options: ImageListOptions{
68 Filters: make(Filters).Add("dangling", "false"),
69 },
70 expectedQueryParams: map[string]string{
71 "all": "",
72 "filter": "",
73 "filters": `{"dangling":{"false":true}}`,
74 },
75 },
76 {
77 doc: "with shared size",
78 options: ImageListOptions{
79 SharedSize: true,
80 },
81 expectedQueryParams: map[string]string{
82 "shared-size": "1",
83 },
84 },
85 {
86 doc: "with identity",
87 options: ImageListOptions{
88 Identity: true,
89 },
90 expectedQueryParams: map[string]string{
91 "identity": "1",

Callers

nothing calls this directly

Calls 13

WithMockClientFunction · 0.85
assertRequestFunction · 0.85
mockJSONResponseFunction · 0.85
ErrorfMethod · 0.80
CheckMethod · 0.80
NewFunction · 0.70
AddMethod · 0.65
RunMethod · 0.65
GetMethod · 0.65
CloseMethod · 0.65
ImageListMethod · 0.65
ContextMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…