From a0751bb34357841497cdc4cec750ba6ce2926453 Mon Sep 17 00:00:00 2001 From: Ian Howell Date: Tue, 12 Nov 2019 15:43:41 -0600 Subject: [PATCH] Remove a duplicated unit test This drops the TestSpecifyKubeConfigInCli unit test, as it as a duplicate of TestInitFlags. Change-Id: I69a8f5f0151e9c8b9906c1b3076e16304c50831a --- pkg/environment/settings_test.go | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) 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()) -}