MCPcopy
hub / github.com/basecamp/once / assertContainerRunning

Function assertContainerRunning

integration/docker_test.go:917–931  ·  view source on GitHub ↗
(t *testing.T, ctx context.Context, name string, expectRunning bool)

Source from the content-addressed store, hash-verified

915}
916
917func assertContainerRunning(t *testing.T, ctx context.Context, name string, expectRunning bool) {
918 t.Helper()
919 c, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
920 require.NoError(t, err)
921 defer c.Close()
922
923 info, err := c.ContainerInspect(ctx, name)
924 require.NoError(t, err)
925
926 if expectRunning {
927 assert.True(t, info.State.Running, "container should be running")
928 } else {
929 assert.False(t, info.State.Running, "container should be stopped")
930 }
931}
932
933func assertContainerResources(t *testing.T, ctx context.Context, name string, expectedCPUs, expectedMemory int64) {
934 t.Helper()

Callers 1

TestStartStopFunction · 0.85

Calls 2

ContainerInspectMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…