Ash Wilson | b73b7f8 | 2014-08-29 15:38:06 -0400 | [diff] [blame] | 1 | package services |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/rackspace/gophercloud" |
| 7 | ) |
| 8 | |
Ash Wilson | 3f59ade | 2014-10-02 09:22:23 -0400 | [diff] [blame] | 9 | func TestListURL(t *testing.T) { |
Ash Wilson | b73b7f8 | 2014-08-29 15:38:06 -0400 | [diff] [blame] | 10 | client := gophercloud.ServiceClient{Endpoint: "http://localhost:5000/v3/"} |
Ash Wilson | 3f59ade | 2014-10-02 09:22:23 -0400 | [diff] [blame] | 11 | url := listURL(&client) |
Ash Wilson | b73b7f8 | 2014-08-29 15:38:06 -0400 | [diff] [blame] | 12 | if url != "http://localhost:5000/v3/services" { |
| 13 | t.Errorf("Unexpected list URL generated: [%s]", url) |
| 14 | } |
| 15 | } |
Ash Wilson | 6e87003 | 2014-09-02 08:38:27 -0400 | [diff] [blame] | 16 | |
Ash Wilson | 3f59ade | 2014-10-02 09:22:23 -0400 | [diff] [blame] | 17 | func TestServiceURL(t *testing.T) { |
Ash Wilson | 6e87003 | 2014-09-02 08:38:27 -0400 | [diff] [blame] | 18 | client := gophercloud.ServiceClient{Endpoint: "http://localhost:5000/v3/"} |
Ash Wilson | 3f59ade | 2014-10-02 09:22:23 -0400 | [diff] [blame] | 19 | url := serviceURL(&client, "1234") |
Ash Wilson | 6e87003 | 2014-09-02 08:38:27 -0400 | [diff] [blame] | 20 | if url != "http://localhost:5000/v3/services/1234" { |
| 21 | t.Errorf("Unexpected service URL generated: [%s]", url) |
| 22 | } |
| 23 | } |