Ash Wilson | 0a997f8 | 2014-09-03 15:50:52 -0400 | [diff] [blame] | 1 | package endpoints |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/rackspace/gophercloud" |
| 7 | ) |
| 8 | |
| 9 | func TestGetListURL(t *testing.T) { |
| 10 | client := gophercloud.ServiceClient{Endpoint: "http://localhost:5000/v3/"} |
Ash Wilson | 1e1b733 | 2014-09-30 16:38:11 -0400 | [diff] [blame^] | 11 | url := listURL(&client) |
Ash Wilson | 0a997f8 | 2014-09-03 15:50:52 -0400 | [diff] [blame] | 12 | if url != "http://localhost:5000/v3/endpoints" { |
| 13 | t.Errorf("Unexpected list URL generated: [%s]", url) |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | func TestGetEndpointURL(t *testing.T) { |
| 18 | client := gophercloud.ServiceClient{Endpoint: "http://localhost:5000/v3/"} |
Ash Wilson | 1e1b733 | 2014-09-30 16:38:11 -0400 | [diff] [blame^] | 19 | url := endpointURL(&client, "1234") |
Ash Wilson | 0a997f8 | 2014-09-03 15:50:52 -0400 | [diff] [blame] | 20 | if url != "http://localhost:5000/v3/endpoints/1234" { |
| 21 | t.Errorf("Unexpected service URL generated: [%s]", url) |
| 22 | } |
| 23 | } |