Jon Perritt | 24270c4 | 2014-10-21 21:11:04 -0500 | [diff] [blame] | 1 | package networks |
| 2 | |
| 3 | import ( |
Jon Perritt | 44b1ea2 | 2014-10-22 00:13:23 -0500 | [diff] [blame] | 4 | "testing" |
Jon Perritt | 24270c4 | 2014-10-21 21:11:04 -0500 | [diff] [blame] | 5 | |
Jon Perritt | 44b1ea2 | 2014-10-22 00:13:23 -0500 | [diff] [blame] | 6 | "github.com/rackspace/gophercloud" |
| 7 | th "github.com/rackspace/gophercloud/testhelper" |
Jon Perritt | 24270c4 | 2014-10-21 21:11:04 -0500 | [diff] [blame] | 8 | ) |
| 9 | |
Jon Perritt | 44b1ea2 | 2014-10-22 00:13:23 -0500 | [diff] [blame] | 10 | const endpoint = "http://localhost:57909/" |
Jon Perritt | 24270c4 | 2014-10-21 21:11:04 -0500 | [diff] [blame] | 11 | |
| 12 | func endpointClient() *gophercloud.ServiceClient { |
Jon Perritt | 44b1ea2 | 2014-10-22 00:13:23 -0500 | [diff] [blame] | 13 | return &gophercloud.ServiceClient{Endpoint: endpoint} |
Jon Perritt | 24270c4 | 2014-10-21 21:11:04 -0500 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | func TestGetURL(t *testing.T) { |
Jon Perritt | 44b1ea2 | 2014-10-22 00:13:23 -0500 | [diff] [blame] | 17 | actual := getURL(endpointClient(), "foo") |
| 18 | expected := endpoint + "os-networksv2/foo" |
| 19 | th.AssertEquals(t, expected, actual) |
Jon Perritt | 24270c4 | 2014-10-21 21:11:04 -0500 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | func TestCreateURL(t *testing.T) { |
Jon Perritt | 44b1ea2 | 2014-10-22 00:13:23 -0500 | [diff] [blame] | 23 | actual := createURL(endpointClient()) |
| 24 | expected := endpoint + "os-networksv2" |
| 25 | th.AssertEquals(t, expected, actual) |
Jon Perritt | 24270c4 | 2014-10-21 21:11:04 -0500 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | func TestListURL(t *testing.T) { |
Jon Perritt | 44b1ea2 | 2014-10-22 00:13:23 -0500 | [diff] [blame] | 29 | actual := createURL(endpointClient()) |
| 30 | expected := endpoint + "os-networksv2" |
| 31 | th.AssertEquals(t, expected, actual) |
Jon Perritt | 24270c4 | 2014-10-21 21:11:04 -0500 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | func TestDeleteURL(t *testing.T) { |
Jon Perritt | 44b1ea2 | 2014-10-22 00:13:23 -0500 | [diff] [blame] | 35 | actual := deleteURL(endpointClient(), "foo") |
| 36 | expected := endpoint + "os-networksv2/foo" |
| 37 | th.AssertEquals(t, expected, actual) |
Jon Perritt | 24270c4 | 2014-10-21 21:11:04 -0500 | [diff] [blame] | 38 | } |