Jamie Hannaford | 4721abc | 2014-09-16 16:29:04 +0200 | [diff] [blame] | 1 | package apiversions |
Jamie Hannaford | 1ce30f2 | 2014-09-16 11:23:34 +0200 | [diff] [blame] | 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/rackspace/gophercloud" |
| 7 | th "github.com/rackspace/gophercloud/testhelper" |
| 8 | ) |
| 9 | |
Jamie Hannaford | c65e192 | 2014-09-22 13:20:58 +0200 | [diff] [blame] | 10 | const endpoint = "http://localhost:57909/" |
Jamie Hannaford | 1ce30f2 | 2014-09-16 11:23:34 +0200 | [diff] [blame] | 11 | |
Jamie Hannaford | c65e192 | 2014-09-22 13:20:58 +0200 | [diff] [blame] | 12 | func endpointClient() *gophercloud.ServiceClient { |
| 13 | return &gophercloud.ServiceClient{Endpoint: endpoint} |
Jamie Hannaford | 1ce30f2 | 2014-09-16 11:23:34 +0200 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | func TestAPIVersionsURL(t *testing.T) { |
Jamie Hannaford | c65e192 | 2014-09-22 13:20:58 +0200 | [diff] [blame] | 17 | actual := apiVersionsURL(endpointClient()) |
| 18 | expected := endpoint |
Jamie Hannaford | 1ce30f2 | 2014-09-16 11:23:34 +0200 | [diff] [blame] | 19 | th.AssertEquals(t, expected, actual) |
| 20 | } |
| 21 | |
| 22 | func TestAPIInfoURL(t *testing.T) { |
Jamie Hannaford | c65e192 | 2014-09-22 13:20:58 +0200 | [diff] [blame] | 23 | actual := apiInfoURL(endpointClient(), "v2.0") |
| 24 | expected := endpoint + "v2.0/" |
Jamie Hannaford | 1ce30f2 | 2014-09-16 11:23:34 +0200 | [diff] [blame] | 25 | th.AssertEquals(t, expected, actual) |
| 26 | } |