airshipctl/pkg/bootstrap/isogen/config_test.go
Dmitry Ukov b37b6f3703 [AIR-137] Add logic to isogen subcommand
* Add add default values for isogen subcommand keys
* Introduce container interface
* Implement docker driver
* Add stdin support to container interface
* Implement volume mount for container

Change-Id: Ide0ecd474b1ccce358bdc9c85ef0006f230490b5
2019-11-01 12:27:35 +00:00

29 lines
468 B
Go

package isogen
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func TestToYaml(t *testing.T) {
expectedBytes := []byte(`builder: {}
container:
containerRuntime: docker
`)
cnf := &Config{
Container: Container{
ContainerRuntime: "docker",
},
}
actualBytes, _ := cnf.ToYAML()
errS := fmt.Sprintf(
"Call ToYAML should have returned %s, got %s",
expectedBytes,
actualBytes,
)
assert.Equal(t, actualBytes, expectedBytes, errS)
}