(t *testing.T)
| 2480 | } |
| 2481 | |
| 2482 | func TestContainerImage(t *testing.T) { |
| 2483 | t.Parallel() |
| 2484 | |
| 2485 | ctx, cancel := testContext(t) |
| 2486 | defer cancel() |
| 2487 | id := t.Name() |
| 2488 | |
| 2489 | client, err := newClient(t, address) |
| 2490 | if err != nil { |
| 2491 | t.Fatal(err) |
| 2492 | } |
| 2493 | defer client.Close() |
| 2494 | |
| 2495 | image, err := client.GetImage(ctx, testImage) |
| 2496 | if err != nil { |
| 2497 | t.Fatal(err) |
| 2498 | } |
| 2499 | |
| 2500 | container, err := client.NewContainer(ctx, id, WithNewSpec(), WithImage(image)) |
| 2501 | if err != nil { |
| 2502 | t.Fatal(err) |
| 2503 | } |
| 2504 | defer container.Delete(ctx) |
| 2505 | |
| 2506 | i, err := container.Image(ctx) |
| 2507 | if err != nil { |
| 2508 | t.Fatal(err) |
| 2509 | } |
| 2510 | if i.Name() != image.Name() { |
| 2511 | t.Fatalf("expected container image name %s but received %s", image.Name(), i.Name()) |
| 2512 | } |
| 2513 | } |
| 2514 | |
| 2515 | func TestContainerNoImage(t *testing.T) { |
| 2516 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…