Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit fbc0409

Browse files
committed
fix duplicate var in tokens v2 acceptance test
1 parent 53d1dc4 commit fbc0409

File tree

1 file changed

+1
-34
lines changed

1 file changed

+1
-34
lines changed

acceptance/rackspace/identity/v2/tokens_test.go

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,10 @@ import (
66
"os"
77
"testing"
88

9-
"github.com/rackspace/gophercloud"
10-
"github.com/rackspace/gophercloud/acceptance/tools"
11-
"github.com/rackspace/gophercloud/rackspace"
129
"github.com/rackspace/gophercloud/rackspace/identity/v2/tokens"
1310
th "github.com/rackspace/gophercloud/testhelper"
1411
)
1512

16-
func rackspaceAuthOptions(t *testing.T) gophercloud.AuthOptions {
17-
// Obtain credentials from the environment.
18-
options, err := rackspace.AuthOptionsFromEnv()
19-
th.AssertNoErr(t, err)
20-
options = tools.OnlyRS(options)
21-
22-
if options.Username == "" {
23-
t.Fatal("Please provide a Rackspace username as RS_USERNAME.")
24-
}
25-
if options.APIKey == "" {
26-
t.Fatal("Please provide a Rackspace API key as RS_API_KEY.")
27-
}
28-
29-
return options
30-
}
31-
32-
func createClient(t *testing.T, auth bool) *gophercloud.ServiceClient {
33-
ao := rackspaceAuthOptions(t)
34-
35-
provider, err := rackspace.NewClient(ao.IdentityEndpoint)
36-
th.AssertNoErr(t, err)
37-
38-
if auth {
39-
err = rackspace.Authenticate(provider, ao)
40-
th.AssertNoErr(t, err)
41-
}
42-
43-
return rackspace.NewIdentityV2(provider)
44-
}
45-
4613
func TestTokenAuth(t *testing.T) {
4714
authedClient := createClient(t, true)
4815
token := authedClient.TokenID
@@ -54,7 +21,7 @@ func TestTokenAuth(t *testing.T) {
5421

5522
authOpts := tokens.AuthOptions{}
5623
authOpts.TenantID = tenantID
57-
authOpts.Token = token
24+
authOpts.TokenID = token
5825

5926
_, err := tokens.Create(authedClient, authOpts).ExtractToken()
6027
th.AssertNoErr(t, err)

0 commit comments

Comments
 (0)