| Jon Perritt | fd53bba | 2014-10-03 00:41:22 -0500 | [diff] [blame] | 1 | package apiversions | 
|  | 2 |  | 
|  | 3 | import ( | 
|  | 4 | "testing" | 
|  | 5 |  | 
| Jon Perritt | 27249f4 | 2016-02-18 10:35:59 -0600 | [diff] [blame^] | 6 | "github.com/gophercloud/gophercloud" | 
|  | 7 | th "github.com/gophercloud/gophercloud/testhelper" | 
| Jon Perritt | fd53bba | 2014-10-03 00:41:22 -0500 | [diff] [blame] | 8 | ) | 
|  | 9 |  | 
|  | 10 | const endpoint = "http://localhost:57909/" | 
|  | 11 |  | 
|  | 12 | func endpointClient() *gophercloud.ServiceClient { | 
|  | 13 | return &gophercloud.ServiceClient{Endpoint: endpoint} | 
|  | 14 | } | 
|  | 15 |  | 
|  | 16 | func TestGetURL(t *testing.T) { | 
|  | 17 | actual := getURL(endpointClient(), "v1") | 
|  | 18 | expected := endpoint + "v1/" | 
|  | 19 | th.AssertEquals(t, expected, actual) | 
|  | 20 | } | 
|  | 21 |  | 
|  | 22 | func TestListURL(t *testing.T) { | 
|  | 23 | actual := listURL(endpointClient()) | 
|  | 24 | expected := endpoint | 
|  | 25 | th.AssertEquals(t, expected, actual) | 
|  | 26 | } |