b37b6f3703
* 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
29 lines
468 B
Go
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)
|
|
}
|