Skip to content

Commit

Permalink
FIx
Browse files Browse the repository at this point in the history
  • Loading branch information
remyleone committed Jun 1, 2020
1 parent 63ebcb1 commit 0053296
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions internal/core/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ func createTestClient(t *testing.T, testConfig *TestConfig) (client *scw.Client,
scw.WithDefaultZone(scw.ZoneFrPar1),
scw.WithAuth("SCWXXXXXXXXXXXXXXXXX", "11111111-1111-1111-1111-111111111111"),
scw.WithDefaultOrganizationID("11111111-1111-1111-1111-111111111111"),
scw.WithEnv(),
scw.WithUserAgent("cli-e2e-test"),
}

Expand All @@ -191,11 +190,14 @@ func createTestClient(t *testing.T, testConfig *TestConfig) (client *scw.Client,
require.NoError(t, err)
clientOpts = append(clientOpts, scw.WithHTTPClient(httpClient))

config, err := scw.LoadConfig()
if err == nil {
p, err := config.GetActiveProfile()
require.NoError(t, err)
clientOpts = append(clientOpts, scw.WithProfile(p))
if UpdateCassettes {
clientOpts = append(clientOpts, scw.WithEnv())
config, err := scw.LoadConfig()
if err == nil {
p, err := config.GetActiveProfile()
require.NoError(t, err)
clientOpts = append(clientOpts, scw.WithProfile(p))
}
}
}

Expand Down

0 comments on commit 0053296

Please sign in to comment.