(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestImport(t *testing.T) { |
| 12 | runtime, cleanup := testNewRuntime(t) |
| 13 | defer cleanup() |
| 14 | ctx := context.Background() |
| 15 | |
| 16 | importOptions := &ImportOptions{} |
| 17 | importOptions.Writer = os.Stdout |
| 18 | |
| 19 | for _, tag := range []string{"", "foobar"} { |
| 20 | importOptions.Tag = tag |
| 21 | imported, err := runtime.Import(ctx, "testdata/exported-container.tar", importOptions) |
| 22 | require.NoError(t, err) |
| 23 | |
| 24 | image, resolvedName, err := runtime.LookupImage(imported, nil) |
| 25 | require.NoError(t, err) |
| 26 | require.Equal(t, imported, resolvedName) |
| 27 | require.Equal(t, "sha256:"+image.ID(), imported) |
| 28 | |
| 29 | if tag != "" { |
| 30 | _, _, err := runtime.LookupImage(tag, nil) |
| 31 | require.NoError(t, err) |
| 32 | } |
| 33 | } |
| 34 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…