blob: 549c398620a9543bf838e39ad4d74149771dbb46 [file] [log] [blame]
Ash Wilsonb482d542014-08-28 15:48:04 -04001package tokens
2
3import (
4 "testing"
5
6 "github.com/rackspace/gophercloud"
Ash Wilson0ab4d612014-08-29 11:10:13 -04007 "github.com/rackspace/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}