From 0cc1b765e03665e3e7b746c4ca52653df01e404f Mon Sep 17 00:00:00 2001 From: Henrique Moraes Date: Tue, 18 Aug 2020 16:32:09 -0300 Subject: [PATCH] Actually removing test files --- pkg/env/envcredential/env_credential_test.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkg/env/envcredential/env_credential_test.go b/pkg/env/envcredential/env_credential_test.go index 3e9b623bc..eeb2fe975 100644 --- a/pkg/env/envcredential/env_credential_test.go +++ b/pkg/env/envcredential/env_credential_test.go @@ -26,8 +26,13 @@ import ( ) func TestCredentialResolver(t *testing.T) { + fileManager := stream.NewFileManager() tempDirectory := os.TempDir() - defer os.Remove(tempDirectory) + contextFinder := rcontext.NewFinder(tempDirectory, fileManager) + credentialSetter := credential.NewSetter(tempDirectory, contextFinder) + credentialFinder := credential.NewFinder(tempDirectory, contextFinder, fileManager) + + defer os.RemoveAll(credential.File(tempDirectory, "", "")) var tests = []struct { name string @@ -51,11 +56,6 @@ func TestCredentialResolver(t *testing.T) { }, } - fileManager := stream.NewFileManager() - contextFinder := rcontext.NewFinder(tempDirectory, fileManager) - credentialSetter := credential.NewSetter(tempDirectory, contextFinder) - credentialFinder := credential.NewFinder(tempDirectory, contextFinder, fileManager) - for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { credentialResolver := NewResolver(credentialFinder, credentialSetter, passwordMock{tt.output}) @@ -66,7 +66,6 @@ func TestCredentialResolver(t *testing.T) { if credentialValue != tt.output { t.Errorf("Resolve credentials failed to retrieve. Expected %v, got %v", tt.output, credentialValue) } - }) } }