Jon Perritt | f81e17a | 2014-09-15 01:29:41 -0500 | [diff] [blame] | 1 | package objects |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
Jon Perritt | ea4e301 | 2014-10-09 22:03:19 -0500 | [diff] [blame^] | 5 | |
Jon Perritt | f81e17a | 2014-09-15 01:29:41 -0500 | [diff] [blame] | 6 | "github.com/rackspace/gophercloud" |
Jon Perritt | ea4e301 | 2014-10-09 22:03:19 -0500 | [diff] [blame^] | 7 | th "github.com/rackspace/gophercloud/testhelper" |
Jon Perritt | f81e17a | 2014-09-15 01:29:41 -0500 | [diff] [blame] | 8 | ) |
| 9 | |
Jon Perritt | ea4e301 | 2014-10-09 22:03:19 -0500 | [diff] [blame^] | 10 | const endpoint = "http://localhost:57909/" |
| 11 | |
| 12 | func endpointClient() *gophercloud.ServiceClient { |
| 13 | return &gophercloud.ServiceClient{Endpoint: endpoint} |
Jon Perritt | f81e17a | 2014-09-15 01:29:41 -0500 | [diff] [blame] | 14 | } |
| 15 | |
Jon Perritt | ea4e301 | 2014-10-09 22:03:19 -0500 | [diff] [blame^] | 16 | func TestListURL(t *testing.T) { |
| 17 | actual := listURL(endpointClient(), "foo") |
| 18 | expected := endpoint + "foo" |
| 19 | th.CheckEquals(t, expected, actual) |
| 20 | } |
| 21 | |
| 22 | func TestCopyURL(t *testing.T) { |
| 23 | actual := copyURL(endpointClient(), "foo", "bar") |
| 24 | expected := endpoint + "foo/bar" |
| 25 | th.CheckEquals(t, expected, actual) |
| 26 | } |
| 27 | |
| 28 | func TestCreateURL(t *testing.T) { |
| 29 | actual := createURL(endpointClient(), "foo", "bar") |
| 30 | expected := endpoint + "foo/bar" |
| 31 | th.CheckEquals(t, expected, actual) |
| 32 | } |
| 33 | |
| 34 | func TestGetURL(t *testing.T) { |
| 35 | actual := getURL(endpointClient(), "foo", "bar") |
| 36 | expected := endpoint + "foo/bar" |
| 37 | th.CheckEquals(t, expected, actual) |
| 38 | } |
| 39 | |
| 40 | func TestDeleteURL(t *testing.T) { |
| 41 | actual := deleteURL(endpointClient(), "foo", "bar") |
| 42 | expected := endpoint + "foo/bar" |
| 43 | th.CheckEquals(t, expected, actual) |
| 44 | } |
| 45 | |
| 46 | func TestDownloadURL(t *testing.T) { |
| 47 | actual := downloadURL(endpointClient(), "foo", "bar") |
| 48 | expected := endpoint + "foo/bar" |
| 49 | th.CheckEquals(t, expected, actual) |
| 50 | } |
| 51 | |
| 52 | func TestUpdateURL(t *testing.T) { |
| 53 | actual := updateURL(endpointClient(), "foo", "bar") |
| 54 | expected := endpoint + "foo/bar" |
| 55 | th.CheckEquals(t, expected, actual) |
Jon Perritt | f81e17a | 2014-09-15 01:29:41 -0500 | [diff] [blame] | 56 | } |