Jon Perritt | 7adfd54 | 2014-10-08 11:14:59 -0500 | [diff] [blame] | 1 | package flavors |
| 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 TestGetURL(t *testing.T) { |
| 17 | actual := getURL(endpointClient(), "foo") |
| 18 | expected := endpoint + "flavors/foo" |
| 19 | th.CheckEquals(t, expected, actual) |
| 20 | } |
| 21 | |
| 22 | func TestListURL(t *testing.T) { |
Jon Perritt | c5679eb | 2014-10-14 11:22:43 -0500 | [diff] [blame] | 23 | actual := listURL(endpointClient()) |
| 24 | expected := endpoint + "flavors/detail" |
| 25 | th.CheckEquals(t, expected, actual) |
Jon Perritt | 7adfd54 | 2014-10-08 11:14:59 -0500 | [diff] [blame] | 26 | } |