MCPcopy
hub / github.com/google/go-containerregistry / TestWriteIndex_Progress

Function TestWriteIndex_Progress

pkg/v1/remote/progress_test.go:167–194  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

165}
166
167func TestWriteIndex_Progress(t *testing.T) {
168 idx, err := random.Index(1000, 3, 3)
169 if err != nil {
170 t.Fatal(err)
171 }
172 c := make(chan v1.Update, 200)
173
174 // Set up a fake registry.
175 s := httptest.NewServer(registry.New())
176 defer s.Close()
177 u, err := url.Parse(s.URL)
178 if err != nil {
179 t.Fatal(err)
180 }
181 dst := fmt.Sprintf("%s/test/progress/upload", u.Host)
182 ref, err := name.ParseReference(dst)
183 if err != nil {
184 t.Fatal(err)
185 }
186
187 if err := WriteIndex(ref, idx, WithProgress(c)); err != nil {
188 t.Fatalf("WriteIndex: %v", err)
189 }
190
191 if err := checkUpdates(c); err != nil {
192 t.Fatal(err)
193 }
194}
195
196func TestMultiWrite_Progress(t *testing.T) {
197 idx, err := random.Index(1000, 3, 3)

Callers

nothing calls this directly

Calls 7

IndexFunction · 0.92
NewFunction · 0.92
ParseReferenceFunction · 0.92
WriteIndexFunction · 0.85
checkUpdatesFunction · 0.85
WithProgressFunction · 0.70
CloseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…