Jon Perritt | e747a0f | 2014-09-29 19:54:55 -0500 | [diff] [blame] | 1 | package volumes |
Jon Perritt | 82522ca | 2014-09-29 22:31:31 -0500 | [diff] [blame] | 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/rackspace/gophercloud" |
| 7 | th "github.com/rackspace/gophercloud/testhelper" |
| 8 | ) |
| 9 | |
| 10 | const endpoint = "http://localhost:57909" |
| 11 | |
| 12 | func endpointClient() *gophercloud.ServiceClient { |
| 13 | return &gophercloud.ServiceClient{Endpoint: endpoint} |
| 14 | } |
| 15 | |
| 16 | func TestVolumesURL(t *testing.T) { |
| 17 | actual := volumesURL(endpointClient()) |
| 18 | expected := endpoint + "volumes" |
| 19 | th.AssertEquals(t, expected, actual) |
| 20 | } |
| 21 | |
| 22 | func TestVolumeURL(t *testing.T) { |
| 23 | actual := volumeURL(endpointClient(), "foo") |
| 24 | expected := endpoint + "volumes/foo" |
| 25 | th.AssertEquals(t, expected, actual) |
| 26 | } |