1- package buildtoollogin
1+ package packagemanagerlogin
22
33import (
44 "fmt"
@@ -41,24 +41,24 @@ var testCases = []struct {
4141 },
4242}
4343
44- func createTestBuildToolLoginCommand ( buildTool project.ProjectType ) * BuildToolLoginCommand {
45- cmd := NewBuildToolLoginCommand ( buildTool )
44+ func createTestPackageManagerLoginCommand ( packageManager project.ProjectType ) * PackageManagerLoginCommand {
45+ cmd := NewPackageManagerLoginCommand ( packageManager )
4646 cmd .repoName = "test-repo"
4747 dummyUrl := "https://acme.jfrog.io"
4848 cmd .serverDetails = & config.ServerDetails {Url : dummyUrl , ArtifactoryUrl : dummyUrl + "/artifactory" }
4949
5050 return cmd
5151}
5252
53- func TestBuildToolLoginCommand_Npm (t * testing.T ) {
53+ func TestPackageManagerLoginCommand_Npm (t * testing.T ) {
5454 // Create a temporary directory to act as the environment's npmrc file location.
5555 tempDir := t .TempDir ()
5656 npmrcFilePath := filepath .Join (tempDir , ".npmrc" )
5757
5858 // Set NPM_CONFIG_USERCONFIG to point to the temporary npmrc file path.
5959 t .Setenv ("NPM_CONFIG_USERCONFIG" , npmrcFilePath )
6060
61- npmLoginCmd := createTestBuildToolLoginCommand (project .Npm )
61+ npmLoginCmd := createTestPackageManagerLoginCommand (project .Npm )
6262
6363 for _ , testCase := range testCases {
6464 t .Run (testCase .name , func (t * testing.T ) {
@@ -96,7 +96,7 @@ func TestBuildToolLoginCommand_Npm(t *testing.T) {
9696 }
9797}
9898
99- func TestBuildToolLoginCommand_Yarn (t * testing.T ) {
99+ func TestPackageManagerLoginCommand_Yarn (t * testing.T ) {
100100 // Retrieve the home directory and construct the .yarnrc file path.
101101 homeDir , err := os .UserHomeDir ()
102102 assert .NoError (t , err )
@@ -109,7 +109,7 @@ func TestBuildToolLoginCommand_Yarn(t *testing.T) {
109109 assert .NoError (t , restoreYarnrcFunc ())
110110 }()
111111
112- yarnLoginCmd := createTestBuildToolLoginCommand (project .Yarn )
112+ yarnLoginCmd := createTestPackageManagerLoginCommand (project .Yarn )
113113
114114 for _ , testCase := range testCases {
115115 t .Run (testCase .name , func (t * testing.T ) {
@@ -147,17 +147,17 @@ func TestBuildToolLoginCommand_Yarn(t *testing.T) {
147147 }
148148}
149149
150- func TestBuildToolLoginCommand_Pip (t * testing.T ) {
150+ func TestPackageManagerLoginCommand_Pip (t * testing.T ) {
151151 // pip and pipenv share the same configuration file.
152- testBuildToolLoginCommandPip (t , project .Pip )
152+ testPackageManagerLoginCommandPip (t , project .Pip )
153153}
154154
155- func TestBuildToolLoginCommand_Pipenv (t * testing.T ) {
155+ func TestPackageManagerLoginCommand_Pipenv (t * testing.T ) {
156156 // pip and pipenv share the same configuration file.
157- testBuildToolLoginCommandPip (t , project .Pipenv )
157+ testPackageManagerLoginCommandPip (t , project .Pipenv )
158158}
159159
160- func testBuildToolLoginCommandPip (t * testing.T , buildTool project.ProjectType ) {
160+ func testPackageManagerLoginCommandPip (t * testing.T , packageManager project.ProjectType ) {
161161 var pipConfFilePath string
162162 if coreutils .IsWindows () {
163163 pipConfFilePath = filepath .Join (os .Getenv ("APPDATA" ), "pip" , "pip.ini" )
@@ -174,7 +174,7 @@ func testBuildToolLoginCommandPip(t *testing.T, buildTool project.ProjectType) {
174174 assert .NoError (t , restorePipConfFunc ())
175175 }()
176176
177- pipLoginCmd := createTestBuildToolLoginCommand ( buildTool )
177+ pipLoginCmd := createTestPackageManagerLoginCommand ( packageManager )
178178
179179 for _ , testCase := range testCases {
180180 t .Run (testCase .name , func (t * testing.T ) {
@@ -211,7 +211,7 @@ func testBuildToolLoginCommandPip(t *testing.T, buildTool project.ProjectType) {
211211 }
212212}
213213
214- func TestBuildToolLoginCommand_configurePoetry (t * testing.T ) {
214+ func TestPackageManagerLoginCommand_configurePoetry (t * testing.T ) {
215215 // Retrieve the home directory and construct the .yarnrc file path.
216216 homeDir , err := os .UserHomeDir ()
217217 assert .NoError (t , err )
@@ -239,7 +239,7 @@ func TestBuildToolLoginCommand_configurePoetry(t *testing.T) {
239239 assert .NoError (t , restorePoetryAuthFunc ())
240240 }()
241241
242- poetryLoginCmd := createTestBuildToolLoginCommand (project .Poetry )
242+ poetryLoginCmd := createTestPackageManagerLoginCommand (project .Poetry )
243243
244244 for _ , testCase := range testCases {
245245 t .Run (testCase .name , func (t * testing.T ) {
@@ -286,14 +286,14 @@ func TestBuildToolLoginCommand_configurePoetry(t *testing.T) {
286286 }
287287}
288288
289- func TestBuildToolLoginCommand_Go (t * testing.T ) {
289+ func TestPackageManagerLoginCommand_Go (t * testing.T ) {
290290 goProxyEnv := "GOPROXY"
291291 // Restore the original value of the GOPROXY environment variable after the test.
292292 restoreGoProxy := clientTestUtils .SetEnvWithCallbackAndAssert (t , goProxyEnv , "" )
293293 defer restoreGoProxy ()
294294
295- // Assuming createTestBuildToolLoginCommand initializes your Go login command
296- goLoginCmd := createTestBuildToolLoginCommand (project .Go )
295+ // Assuming createTestPackageManagerLoginCommand initializes your Go login command
296+ goLoginCmd := createTestPackageManagerLoginCommand (project .Go )
297297
298298 for _ , testCase := range testCases {
299299 t .Run (testCase .name , func (t * testing.T ) {
0 commit comments