Jon Perritt | f050a4c | 2014-09-11 15:01:17 -0500 | [diff] [blame] | 1 | // +build acceptance |
2 | |||||
3 | package v1 | ||||
4 | |||||
5 | import ( | ||||
Jon Perritt | 2a7797d | 2014-10-21 15:08:43 -0500 | [diff] [blame] | 6 | "os" |
Ash Wilson | 0036cbf | 2014-10-24 15:29:48 -0400 | [diff] [blame^] | 7 | "testing" |
Jon Perritt | 2a7797d | 2014-10-21 15:08:43 -0500 | [diff] [blame] | 8 | |
Jon Perritt | f050a4c | 2014-09-11 15:01:17 -0500 | [diff] [blame] | 9 | "github.com/rackspace/gophercloud" |
10 | "github.com/rackspace/gophercloud/openstack" | ||||
Jon Perritt | 2a7797d | 2014-10-21 15:08:43 -0500 | [diff] [blame] | 11 | th "github.com/rackspace/gophercloud/testhelper" |
Jon Perritt | f050a4c | 2014-09-11 15:01:17 -0500 | [diff] [blame] | 12 | ) |
13 | |||||
14 | var metadata = map[string]string{"gopher": "cloud"} | ||||
15 | |||||
Ash Wilson | 0036cbf | 2014-10-24 15:29:48 -0400 | [diff] [blame^] | 16 | func newClient(t *testing.T) *gophercloud.ServiceClient { |
Jamie Hannaford | 390555a | 2014-10-22 17:04:03 +0200 | [diff] [blame] | 17 | ao, err := openstack.AuthOptionsFromEnv() |
Jon Perritt | 2a7797d | 2014-10-21 15:08:43 -0500 | [diff] [blame] | 18 | th.AssertNoErr(t, err) |
Jon Perritt | f050a4c | 2014-09-11 15:01:17 -0500 | [diff] [blame] | 19 | |
20 | client, err := openstack.AuthenticatedClient(ao) | ||||
Jon Perritt | 2a7797d | 2014-10-21 15:08:43 -0500 | [diff] [blame] | 21 | th.AssertNoErr(t, err) |
Jon Perritt | f050a4c | 2014-09-11 15:01:17 -0500 | [diff] [blame] | 22 | |
Jon Perritt | 2a7797d | 2014-10-21 15:08:43 -0500 | [diff] [blame] | 23 | return openstack.NewObjectStorageV1(client, gophercloud.EndpointOpts{ |
Jon Perritt | f050a4c | 2014-09-11 15:01:17 -0500 | [diff] [blame] | 24 | Region: os.Getenv("OS_REGION_NAME"), |
Ash Wilson | 0036cbf | 2014-10-24 15:29:48 -0400 | [diff] [blame^] | 25 | }) |
Jon Perritt | f050a4c | 2014-09-11 15:01:17 -0500 | [diff] [blame] | 26 | } |