| "github.com/rackspace/gophercloud" |
| os "github.com/rackspace/gophercloud/openstack/identity/v2/tokens" |
| th "github.com/rackspace/gophercloud/testhelper" |
| "github.com/rackspace/gophercloud/testhelper/client" |
| func tokenPost(t *testing.T, options gophercloud.AuthOptions, requestJSON string) os.CreateResult { |
| os.HandleTokenPost(t, requestJSON) |
| return Create(client.ServiceClient(), WrapOptions(options)) |
| func TestCreateTokenWithAPIKey(t *testing.T) { |
| options := gophercloud.AuthOptions{ |
| APIKey: "1234567890abcdef", |
| os.IsSuccessful(t, tokenPost(t, options, ` |
| "RAX-KSKEY:apiKeyCredentials": { |
| "apiKey": "1234567890abcdef" |