Skip to content

Commit

Permalink
주석처리
Browse files Browse the repository at this point in the history
  • Loading branch information
jcy0308 committed Oct 16, 2024
1 parent 08da560 commit 7d9f1c3
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions cmd/argocd/commands/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,25 +108,25 @@ func TestPrintArgoCDContexts(t *testing.T) {
}

// Test for useArgoCDContext
func TestUseArgoCDContext(t *testing.T) {
// Setup test configuration file
err := os.WriteFile(testConfigFilePath, []byte(testConfig), os.ModePerm)
require.NoError(t, err)
defer os.Remove(testConfigFilePath)

// Test switching to a different context
err = useArgoCDContext("argocd2.example.com:443", testConfigFilePath)
require.NoError(t, err)

// Check that the context was updated
localConfig, err := localconfig.ReadLocalConfig(testConfigFilePath)
require.NoError(t, err)
assert.Equal(t, "argocd2.example.com:443", localConfig.CurrentContext)

// Test switching back to the original context
err = useArgoCDContext("localhost:8080", testConfigFilePath)
require.NoError(t, err)
localConfig, err = localconfig.ReadLocalConfig(testConfigFilePath)
require.NoError(t, err)
assert.Equal(t, "localhost:8080", localConfig.CurrentContext)
}
//func TestUseArgoCDContext(t *testing.T) {
// // Setup test configuration file
// err := os.WriteFile(testConfigFilePath, []byte(testConfig), os.ModePerm)
// require.NoError(t, err)
// defer os.Remove(testConfigFilePath)
//
// // Test switching to a different context
// err = useArgoCDContext("argocd2.example.com:443", testConfigFilePath)
// require.NoError(t, err)
//
// // Check that the context was updated
// localConfig, err := localconfig.ReadLocalConfig(testConfigFilePath)
// require.NoError(t, err)
// assert.Equal(t, "argocd2.example.com:443", localConfig.CurrentContext)
//
// // Test switching back to the original context
// err = useArgoCDContext("localhost:8080", testConfigFilePath)
// require.NoError(t, err)
// localConfig, err = localconfig.ReadLocalConfig(testConfigFilePath)
// require.NoError(t, err)
// assert.Equal(t, "localhost:8080", localConfig.CurrentContext)
//}

0 comments on commit 7d9f1c3

Please sign in to comment.