Jon Perritt | f95e3e4 | 2014-10-21 21:11:25 -0500 | [diff] [blame] | 1 | package virtualinterfaces |
Jon Perritt | 44b1ea2 | 2014-10-22 00:13:23 -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 TestCreateURL(t *testing.T) { |
| 17 | actual := createURL(endpointClient(), "12345") |
| 18 | expected := endpoint + "servers/12345/os-virtual-interfacesv2" |
| 19 | th.AssertEquals(t, expected, actual) |
| 20 | } |
| 21 | |
| 22 | func TestListURL(t *testing.T) { |
| 23 | actual := createURL(endpointClient(), "12345") |
| 24 | expected := endpoint + "servers/12345/os-virtual-interfacesv2" |
| 25 | th.AssertEquals(t, expected, actual) |
| 26 | } |
| 27 | |
| 28 | func TestDeleteURL(t *testing.T) { |
| 29 | actual := deleteURL(endpointClient(), "12345", "6789") |
| 30 | expected := endpoint + "servers/12345/os-virtual-interfacesv2/6789" |
| 31 | th.AssertEquals(t, expected, actual) |
| 32 | } |