Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
Signed-off-by: danish siddiqui <[email protected]>
  • Loading branch information
danish9039 committed Mar 27, 2024
1 parent aef07f5 commit 8578b40
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions pkg/provisioner/ironic/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,38 @@ func TestLoadConfigFromEnv(t *testing.T) {
}
}
}
func TestLoadEndpointsFromEnv(t *testing.T) {
cases := []struct {
name string
env EnvFixture
expectError bool
}{
{
name: "with-ironic",
env: EnvFixture{
ironicEndpoint: "http://ironic.test",
},
}, {
name: "without-ironic",
env: EnvFixture{},
expectError: true,
},
}

for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
defer tc.env.TearDown()
tc.env.SetUp()
i, err := loadEndpointsFromEnv()
if tc.expectError {
assert.NotNil(t, err)
} else {
assert.Nil(t, err)
tc.env.VerifyEndpoints(t, i)
}
})
}
}
func TestLoadTLSConfigFromEnv(t *testing.T) {
const (
TLSKeyFilePath = "/opt/metal3/certs/client/tls.key"
Expand Down

0 comments on commit 8578b40

Please sign in to comment.