blob: e68aef82de4ad8d0e5761d4711a3aa23636e2520 [file] [log] [blame]
Ash Wilson54ce2f42014-10-09 09:26:29 -04001// +build acceptance
2
3package rackspace
4
5import (
6 "testing"
7
8 "github.com/rackspace/gophercloud/openstack/utils"
9 "github.com/rackspace/gophercloud/rackspace"
10)
11
12func TestAuthenticatedClient(t *testing.T) {
13 // Obtain credentials from the environment.
14 ao, err := utils.AuthOptions()
15 if err != nil {
16 t.Fatalf("Unable to acquire credentials: %v", err)
17 }
18
19 client, err := rackspace.AuthenticatedClient(ao)
20 if err != nil {
21 t.Fatalf("Unable to authenticate: %v", err)
22 }
23
24 if client.TokenID == "" {
25 t.Errorf("No token ID assigned to the client")
26 }
27
28 t.Logf("Client successfully acquired a token: %v", client.TokenID)
29}