Skip to content

Commit

Permalink
bib: make image_test.go follow the $pkg_test go pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
mvo5 committed May 28, 2024
1 parent 95e8e12 commit 017c424
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion bib/cmd/bootc-image-builder/export_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package main

var CanChownInPath = canChownInPath
var (
CanChownInPath = canChownInPath
ApplyFilesystemCustomizations = applyFilesystemCustomizations
GetDistroAndRunner = getDistroAndRunner
)

func MockOsGetuid(new func() int) (restore func()) {
saved := osGetuid
Expand Down
8 changes: 5 additions & 3 deletions bib/cmd/bootc-image-builder/image_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package main
package main_test

import (
"fmt"
"testing"

"github.com/osbuild/bootc-image-builder/bib/internal/source"
"github.com/osbuild/images/pkg/manifest"
"github.com/osbuild/images/pkg/runner"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

bib "github.com/osbuild/bootc-image-builder/bib/cmd/bootc-image-builder"
"github.com/osbuild/bootc-image-builder/bib/internal/source"
)

func TestGetDistroAndRunner(t *testing.T) {
Expand Down Expand Up @@ -42,7 +44,7 @@ func TestGetDistroAndRunner(t *testing.T) {
ID: c.id,
VersionID: c.versionID,
}
distro, runner, err := getDistroAndRunner(osRelease)
distro, runner, err := bib.GetDistroAndRunner(osRelease)
if c.expectedErr != "" {
assert.ErrorContains(t, err, c.expectedErr)
} else {
Expand Down

0 comments on commit 017c424

Please sign in to comment.