github.com/ssdev-go/moby@v17.12.1-ce-rc2+incompatible/daemon/inspect_test.go (about) 1 package daemon // import "github.com/docker/docker/daemon" 2 3 import ( 4 "testing" 5 6 containertypes "github.com/docker/docker/api/types/container" 7 "github.com/docker/docker/container" 8 "github.com/docker/docker/daemon/config" 9 "github.com/docker/docker/daemon/exec" 10 11 "github.com/stretchr/testify/assert" 12 ) 13 14 func TestGetInspectData(t *testing.T) { 15 c := &container.Container{ 16 ID: "inspect-me", 17 HostConfig: &containertypes.HostConfig{}, 18 State: container.NewState(), 19 ExecCommands: exec.NewStore(), 20 } 21 22 d := &Daemon{ 23 linkIndex: newLinkIndex(), 24 configStore: &config.Config{}, 25 } 26 27 _, err := d.getInspectData(c) 28 assert.Error(t, err) 29 30 c.Dead = true 31 _, err = d.getInspectData(c) 32 assert.NoError(t, err) 33 }