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 | |
Jon Perritt | 27249f4 | 2016-02-18 10:35:59 -0600 | [diff] [blame] | 6 | "github.com/gophercloud/gophercloud" |
| 7 | th "github.com/gophercloud/gophercloud/testhelper" |
Jon Perritt | 82522ca | 2014-09-29 22:31:31 -0500 | [diff] [blame] | 8 | ) |
| 9 | |
| 10 | const endpoint = "http://localhost:57909" |
| 11 | |
| 12 | func endpointClient() *gophercloud.ServiceClient { |
| 13 | return &gophercloud.ServiceClient{Endpoint: endpoint} |
| 14 | } |
| 15 | |
Jon Perritt | 6d5561b | 2014-10-01 21:42:15 -0500 | [diff] [blame] | 16 | func TestCreateURL(t *testing.T) { |
| 17 | actual := createURL(endpointClient()) |
Jon Perritt | 82522ca | 2014-09-29 22:31:31 -0500 | [diff] [blame] | 18 | expected := endpoint + "volumes" |
| 19 | th.AssertEquals(t, expected, actual) |
| 20 | } |
| 21 | |
Jon Perritt | 6d5561b | 2014-10-01 21:42:15 -0500 | [diff] [blame] | 22 | func TestListURL(t *testing.T) { |
| 23 | actual := listURL(endpointClient()) |
| 24 | expected := endpoint + "volumes" |
| 25 | th.AssertEquals(t, expected, actual) |
| 26 | } |
| 27 | |
| 28 | func TestDeleteURL(t *testing.T) { |
| 29 | actual := deleteURL(endpointClient(), "foo") |
| 30 | expected := endpoint + "volumes/foo" |
| 31 | th.AssertEquals(t, expected, actual) |
| 32 | } |
| 33 | |
| 34 | func TestGetURL(t *testing.T) { |
| 35 | actual := getURL(endpointClient(), "foo") |
| 36 | expected := endpoint + "volumes/foo" |
| 37 | th.AssertEquals(t, expected, actual) |
| 38 | } |
| 39 | |
| 40 | func TestUpdateURL(t *testing.T) { |
| 41 | actual := updateURL(endpointClient(), "foo") |
Jon Perritt | 82522ca | 2014-09-29 22:31:31 -0500 | [diff] [blame] | 42 | expected := endpoint + "volumes/foo" |
| 43 | th.AssertEquals(t, expected, actual) |
| 44 | } |