Jon Perritt | 50da9b4 | 2014-09-14 15:06:59 -0500 | [diff] [blame^] | 1 | package containers |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | "github.com/rackspace/gophercloud" |
| 6 | ) |
| 7 | |
| 8 | func TestAccountURL(t *testing.T) { |
| 9 | client := gophercloud.ServiceClient{ |
| 10 | Endpoint: "http://localhost:5000/v1/", |
| 11 | } |
| 12 | expected := "http://localhost:5000/v1/" |
| 13 | actual := accountURL(&client) |
| 14 | if actual != expected { |
| 15 | t.Errorf("Unexpected service URL generated: [%s]", actual) |
| 16 | } |
| 17 | |
| 18 | } |
| 19 | |
| 20 | func TestContainerURL(t *testing.T) { |
| 21 | client := gophercloud.ServiceClient{ |
| 22 | Endpoint: "http://localhost:5000/v1/", |
| 23 | } |
| 24 | expected := "http://localhost:5000/v1/testContainer" |
| 25 | actual := containerURL(&client, "testContainer") |
| 26 | if actual != expected { |
| 27 | t.Errorf("Unexpected service URL generated: [%s]", actual) |
| 28 | } |
| 29 | } |