Moves the files imported from `bootc-image-builder` to the appropriate path under `pkg/` so they can be imported reverse. Also fix up the import paths that are in these files to refer to their new locations. Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
21 lines
480 B
Go
21 lines
480 B
Go
package util_test
|
|
|
|
import (
|
|
"fmt"
|
|
"os/exec"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/osbuild/image-builder-cli/pkg/util"
|
|
)
|
|
|
|
func TestOutputErrPassthrough(t *testing.T) {
|
|
err := fmt.Errorf("boom")
|
|
assert.Equal(t, util.OutputErr(err), err)
|
|
}
|
|
|
|
func TestOutputErrExecError(t *testing.T) {
|
|
_, err := exec.Command("bash", "-c", ">&2 echo some-stderr; exit 1").Output()
|
|
assert.Equal(t, "exit status 1, stderr:\nsome-stderr\n", util.OutputErr(err).Error())
|
|
}
|