mirror of
https://github.com/openshift/installer.git
synced 2026-02-05 15:47:14 +01:00
29 lines
483 B
Go
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)
|
|
}
|
|
}
|