func TestNewFromDocker(t *testing.T) {
	cfg, err := config.NewFromFile("config/testdata/compose.yml", containerTestVars, map[string]interface{}{}, false)
	if err != nil {
		t.Fatal(err)
	}

	container := NewContainerFromConfig(config.NewContainerName("myapp", "main"), cfg.Containers["main"])

	opts, err := container.CreateContainerOptions()
	if err != nil {
		t.Fatal(err)
	}

	apiContainer := &docker.Container{
		Config: &docker.Config{
			Labels: opts.Config.Labels,
		},
		State: docker.State{
			Running: true,
		},
		Name: "/myapp.main",
	}

	configFromAPI, err := config.NewFromDocker(apiContainer)
	if err != nil {
		t.Fatal(err)
	}

	compareResult := cfg.Containers["main"].IsEqualTo(configFromAPI)
	assert.True(t, compareResult,
		"container spec converted from API should be equal to one fetched from config file, failed on field: %s", cfg.Containers["main"].LastCompareField())
}
func TestConfigGetContainers(t *testing.T) {
	cfg, err := config.NewFromFile("config/testdata/compose.yml", containerTestVars, map[string]interface{}{}, false)
	if err != nil {
		t.Fatal(err)
	}

	containers := GetContainersFromConfig(cfg)

	assert.Equal(t, 5, len(containers), "bad containers number from config")
}
func TestCreateContainerOptions(t *testing.T) {
	cfg, err := config.NewFromFile("config/testdata/compose.yml", containerTestVars, map[string]interface{}{}, false)
	if err != nil {
		t.Fatal(err)
	}

	container := NewContainerFromConfig(config.NewContainerName("myapp", "main"), cfg.Containers["main"])

	opts, err := container.CreateContainerOptions()
	if err != nil {
		t.Fatal(err)
	}

	assert.IsType(t, &docker.CreateContainerOptions{}, opts)
}