Ash Wilson | 61dcb02 | 2014-10-03 08:15:47 -0400 | [diff] [blame] | 1 | package extensions |
| 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 TestExtensionURL(t *testing.T) { |
Ash Wilson | 05e4107 | 2014-10-03 16:33:42 -0400 | [diff] [blame] | 17 | actual := ExtensionURL(endpointClient(), "agent") |
Ash Wilson | a493187 | 2014-10-03 15:55:35 -0400 | [diff] [blame] | 18 | expected := endpoint + "extensions/agent" |
Ash Wilson | 61dcb02 | 2014-10-03 08:15:47 -0400 | [diff] [blame] | 19 | th.AssertEquals(t, expected, actual) |
| 20 | } |
| 21 | |
| 22 | func TestListExtensionURL(t *testing.T) { |
Ash Wilson | 05e4107 | 2014-10-03 16:33:42 -0400 | [diff] [blame] | 23 | actual := ListExtensionURL(endpointClient()) |
Ash Wilson | a493187 | 2014-10-03 15:55:35 -0400 | [diff] [blame] | 24 | expected := endpoint + "extensions" |
Ash Wilson | 61dcb02 | 2014-10-03 08:15:47 -0400 | [diff] [blame] | 25 | th.AssertEquals(t, expected, actual) |
| 26 | } |