Jamie Hannaford | af209d1 | 2014-10-22 12:37:48 +0200 | [diff] [blame] | 1 | package v1 |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/rackspace/gophercloud" |
| 7 | "github.com/rackspace/gophercloud/openstack/utils" |
| 8 | "github.com/rackspace/gophercloud/rackspace" |
| 9 | th "github.com/rackspace/gophercloud/testhelper" |
| 10 | ) |
| 11 | |
| 12 | func newClient() (*gophercloud.ServiceClient, error) { |
| 13 | opts, err := utils.AuthOptions() |
| 14 | if err != nil { |
| 15 | return nil, err |
| 16 | } |
| 17 | |
| 18 | provider, err := rackspace.AuthenticatedClient(opts) |
| 19 | if err != nil { |
| 20 | return nil, err |
| 21 | } |
| 22 | |
| 23 | return rackspace.NewBlockStorageV1(provider, gophercloud.EndpointOpts{ |
| 24 | Region: "IAD", |
| 25 | }) |
| 26 | } |
| 27 | |
| 28 | func setup(t *testing.T) *gophercloud.ServiceClient { |
| 29 | client, err := newClient() |
| 30 | th.AssertNoErr(t, err) |
| 31 | |
| 32 | return client |
| 33 | } |