blob: bc919eaaf20fa453202f146c89abef865ee32640 [file] [log] [blame]
Ash Wilsonb482d542014-08-28 15:48:04 -04001package tokens
2
3import (
4 "testing"
5
Jon Perritt27249f42016-02-18 10:35:59 -06006 "github.com/gophercloud/gophercloud"
7 "github.com/gophercloud/gophercloud/testhelper"
Ash Wilsonb482d542014-08-28 15:48:04 -04008)
9
10func TestTokenURL(t *testing.T) {
Ash Wilson0ab4d612014-08-29 11:10:13 -040011 testhelper.SetupHTTP()
12 defer testhelper.TeardownHTTP()
Ash Wilsonb482d542014-08-28 15:48:04 -040013
Ash Wilson6425a412014-08-29 12:30:35 -040014 client := gophercloud.ServiceClient{Endpoint: testhelper.Endpoint()}
Ash Wilsonb482d542014-08-28 15:48:04 -040015
Ash Wilson0ab4d612014-08-29 11:10:13 -040016 expected := testhelper.Endpoint() + "auth/tokens"
Ash Wilson3f59ade2014-10-02 09:22:23 -040017 actual := tokenURL(&client)
Ash Wilsonb482d542014-08-28 15:48:04 -040018 if actual != expected {
19 t.Errorf("Expected URL %s, but was %s", expected, actual)
20 }
21}