Ash Wilson | b482d54 | 2014-08-28 15:48:04 -0400 | [diff] [blame] | 1 | package tokens |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
Jon Perritt | 27249f4 | 2016-02-18 10:35:59 -0600 | [diff] [blame^] | 6 | "github.com/gophercloud/gophercloud" |
| 7 | "github.com/gophercloud/gophercloud/testhelper" |
Ash Wilson | b482d54 | 2014-08-28 15:48:04 -0400 | [diff] [blame] | 8 | ) |
| 9 | |
| 10 | func TestTokenURL(t *testing.T) { |
Ash Wilson | 0ab4d61 | 2014-08-29 11:10:13 -0400 | [diff] [blame] | 11 | testhelper.SetupHTTP() |
| 12 | defer testhelper.TeardownHTTP() |
Ash Wilson | b482d54 | 2014-08-28 15:48:04 -0400 | [diff] [blame] | 13 | |
Ash Wilson | 6425a41 | 2014-08-29 12:30:35 -0400 | [diff] [blame] | 14 | client := gophercloud.ServiceClient{Endpoint: testhelper.Endpoint()} |
Ash Wilson | b482d54 | 2014-08-28 15:48:04 -0400 | [diff] [blame] | 15 | |
Ash Wilson | 0ab4d61 | 2014-08-29 11:10:13 -0400 | [diff] [blame] | 16 | expected := testhelper.Endpoint() + "auth/tokens" |
Ash Wilson | 3f59ade | 2014-10-02 09:22:23 -0400 | [diff] [blame] | 17 | actual := tokenURL(&client) |
Ash Wilson | b482d54 | 2014-08-28 15:48:04 -0400 | [diff] [blame] | 18 | if actual != expected { |
| 19 | t.Errorf("Expected URL %s, but was %s", expected, actual) |
| 20 | } |
| 21 | } |