1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 06:46:36 +01:00
Files
installer/data/unpack_test.go
Eran Cohen 9db8b71f77 Fix UTs
Signed-off-by: Eran Cohen <eranco@redhat.com>
2024-07-16 17:23:34 +03:00

29 lines
483 B
Go

package data
import (
"bytes"
"os"
"path/filepath"
"testing"
)
func TestUnpack(t *testing.T) {
path := t.TempDir()
err := Unpack(path, ".")
if err != nil {
t.Fatal(err)
}
expected := "# Bootstrap Module"
content, err := os.ReadFile(filepath.Join(path, "libvirt", "bootstrap", "README.md"))
if err != nil {
t.Fatal(err)
}
firstLine := string(bytes.SplitN(content, []byte("\n"), 2)[0])
if firstLine != expected {
t.Fatalf("%q != %q", firstLine, expected)
}
}