Skip to content

Commit

Permalink
fix(pkg/driver): fixed tests.
Browse files Browse the repository at this point in the history
Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP authored and poiana committed Apr 23, 2024
1 parent 390edc9 commit 38ea1a3
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/driver/distro/distro_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestDiscoverDistro(t *testing.T) {
return nil
},
postFn: func() {},
distroExpected: nil,
distroExpected: &generic{},
errExpected: true,
},
{
Expand All @@ -63,8 +63,8 @@ func TestDiscoverDistro(t *testing.T) {
postFn: func() {
_ = os.Remove(osReleaseFile)
},
distroExpected: nil,
errExpected: false,
distroExpected: &generic{},
errExpected: true,
},
{
// os-release ID "foo" mapped to generic
Expand Down Expand Up @@ -206,9 +206,8 @@ func TestDiscoverDistro(t *testing.T) {
d, err := Discover(kr, localHostRoot)
if tCase.errExpected {
assert.Error(t, err)
} else {
assert.IsType(t, tCase.distroExpected, d)
}
assert.IsType(t, tCase.distroExpected, d)
tCase.postFn()
}
}

0 comments on commit 38ea1a3

Please sign in to comment.