diff --git a/pkg/environment/settings_test.go b/pkg/environment/settings_test.go index 8e6d15a89..4e31bf9f8 100644 --- a/pkg/environment/settings_test.go +++ b/pkg/environment/settings_test.go @@ -28,21 +28,12 @@ import ( "opendev.org/airship/airshipctl/pkg/config" ) -// Bogus for coverage -func FakeCmd() *cobra.Command { - fakecmd := &cobra.Command{ - Use: "fakecmd", - Run: func(cmd *cobra.Command, args []string) {}, - } - return fakecmd -} - func TestInitFlags(t *testing.T) { // Get the Environment settings := &AirshipCTLSettings{} - fakecmd := FakeCmd() - settings.InitFlags(fakecmd) - assert.True(t, fakecmd.HasPersistentFlags()) + testCmd := &cobra.Command{} + settings.InitFlags(testCmd) + assert.True(t, testCmd.HasPersistentFlags()) } func TestSpecifyAirConfigFromEnv(t *testing.T) { @@ -55,6 +46,7 @@ func TestSpecifyAirConfigFromEnv(t *testing.T) { assert.EqualValues(t, fakeConfig, settings.AirshipConfigPath()) } + func TestGetSetPaths(t *testing.T) { settings := &AirshipCTLSettings{} settings.InitConfig() @@ -66,11 +58,3 @@ func TestGetSetPaths(t *testing.T) { settings.SetKubeConfigPath(kConfigFile) assert.EqualValues(t, kConfigFile, settings.KubeConfigPath()) } - -func TestSpecifyKubeConfigInCli(t *testing.T) { - fakecmd := FakeCmd() - - settings := &AirshipCTLSettings{} - settings.InitFlags(fakecmd) - assert.True(t, fakecmd.HasPersistentFlags()) -}