From 547fa0214bc11d3a9e0b94c80c277cb751da6afa Mon Sep 17 00:00:00 2001 From: Michael Sverdlov Date: Wed, 6 Nov 2024 14:21:32 +0200 Subject: [PATCH] Improve repositores code Signed-off-by: Michael Sverdlov --- artifactory/commands/buildtoollogin/buildtoollogin_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/artifactory/commands/buildtoollogin/buildtoollogin_test.go b/artifactory/commands/buildtoollogin/buildtoollogin_test.go index e44667b82..7da9c6364 100644 --- a/artifactory/commands/buildtoollogin/buildtoollogin_test.go +++ b/artifactory/commands/buildtoollogin/buildtoollogin_test.go @@ -267,6 +267,9 @@ func TestBuildToolLoginCommand_configurePoetry(t *testing.T) { poetryAuthContentBytes, err := os.ReadFile(poetryAuthFilePath) assert.NoError(t, err) poetryAuthContent := string(poetryAuthContentBytes) + // Normalize line endings for comparison.(For Windows) + poetryConfigContent = strings.ReplaceAll(poetryConfigContent, "\r\n", "\n") + if testCase.accessToken != "" { // Validate token-based authentication (The token is stored in the keyring so we can't test it) assert.Contains(t, poetryAuthContent, fmt.Sprintf("[http-basic.test-repo]\nusername = \"%s\"", auth.ExtractUsernameFromAccessToken(testCase.accessToken)))