Jon Perritt | 50da9b4 | 2014-09-14 15:06:59 -0500 | [diff] [blame] | 1 | package containers |
| 2 | |
| 3 | import ( |
Jon Perritt | 50da9b4 | 2014-09-14 15:06:59 -0500 | [diff] [blame] | 4 | "github.com/rackspace/gophercloud" |
Jon Perritt | b346140 | 2014-10-09 21:36:17 -0500 | [diff] [blame^] | 5 | th "github.com/rackspace/gophercloud/testhelper" |
| 6 | "testing" |
Jon Perritt | 50da9b4 | 2014-09-14 15:06:59 -0500 | [diff] [blame] | 7 | ) |
| 8 | |
Jon Perritt | b346140 | 2014-10-09 21:36:17 -0500 | [diff] [blame^] | 9 | const endpoint = "http://localhost:57909/" |
Jon Perritt | 50da9b4 | 2014-09-14 15:06:59 -0500 | [diff] [blame] | 10 | |
Jon Perritt | b346140 | 2014-10-09 21:36:17 -0500 | [diff] [blame^] | 11 | func endpointClient() *gophercloud.ServiceClient { |
| 12 | return &gophercloud.ServiceClient{Endpoint: endpoint} |
Jon Perritt | 50da9b4 | 2014-09-14 15:06:59 -0500 | [diff] [blame] | 13 | } |
| 14 | |
Jon Perritt | b346140 | 2014-10-09 21:36:17 -0500 | [diff] [blame^] | 15 | func TestListURL(t *testing.T) { |
| 16 | actual := listURL(endpointClient()) |
| 17 | expected := endpoint |
| 18 | th.CheckEquals(t, expected, actual) |
| 19 | } |
| 20 | |
| 21 | func TestCreateURL(t *testing.T) { |
| 22 | actual := createURL(endpointClient(), "foo") |
| 23 | expected := endpoint + "foo" |
| 24 | th.CheckEquals(t, expected, actual) |
| 25 | } |
| 26 | |
| 27 | func TestGetURL(t *testing.T) { |
| 28 | actual := getURL(endpointClient(), "foo") |
| 29 | expected := endpoint + "foo" |
| 30 | th.CheckEquals(t, expected, actual) |
| 31 | } |
| 32 | |
| 33 | func TestDeleteURL(t *testing.T) { |
| 34 | actual := deleteURL(endpointClient(), "foo") |
| 35 | expected := endpoint + "foo" |
| 36 | th.CheckEquals(t, expected, actual) |
| 37 | } |
| 38 | |
| 39 | func TestUpdateURL(t *testing.T) { |
| 40 | actual := updateURL(endpointClient(), "foo") |
| 41 | expected := endpoint + "foo" |
| 42 | th.CheckEquals(t, expected, actual) |
Jon Perritt | 50da9b4 | 2014-09-14 15:06:59 -0500 | [diff] [blame] | 43 | } |