MCPcopy Create free account
hub / github.com/containers/image / TestDiffIDComputationGoroutine

Function TestDiffIDComputationGoroutine

copy/single_test.go:112–127  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

110}
111
112func TestDiffIDComputationGoroutine(t *testing.T) {
113 stream, err := os.Open("fixtures/Hello.uncompressed")
114 require.NoError(t, err)
115 res := goDiffIDComputationGoroutineWithTimeout(stream, nil)
116 require.NotNil(t, res)
117 assert.NoError(t, res.err)
118 assert.Equal(t, "sha256:185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969", res.digest.String())
119
120 // Error reading input
121 reader, writer := io.Pipe()
122 err = writer.CloseWithError(errors.New("Expected error reading input in diffIDComputationGoroutine"))
123 require.NoError(t, err)
124 res = goDiffIDComputationGoroutineWithTimeout(reader, nil)
125 require.NotNil(t, res)
126 assert.Error(t, res.err)
127}
128
129func TestComputeDiffID(t *testing.T) {
130 for _, c := range []struct {

Callers

nothing calls this directly

Calls 4

OpenMethod · 0.65
StringMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…