blob: 7dd069c94f512aecceea0735f605659be5e9cd20 [file] [log] [blame]
Jamie Hannaford4721abc2014-09-16 16:29:04 +02001package apiversions
Jamie Hannaford1ce30f22014-09-16 11:23:34 +02002
3import (
4 "testing"
5
6 "github.com/rackspace/gophercloud"
7 th "github.com/rackspace/gophercloud/testhelper"
8)
9
Jamie Hannafordc65e1922014-09-22 13:20:58 +020010const endpoint = "http://localhost:57909/"
Jamie Hannaford1ce30f22014-09-16 11:23:34 +020011
Jamie Hannafordc65e1922014-09-22 13:20:58 +020012func endpointClient() *gophercloud.ServiceClient {
13 return &gophercloud.ServiceClient{Endpoint: endpoint}
Jamie Hannaford1ce30f22014-09-16 11:23:34 +020014}
15
16func TestAPIVersionsURL(t *testing.T) {
Jamie Hannafordc65e1922014-09-22 13:20:58 +020017 actual := apiVersionsURL(endpointClient())
18 expected := endpoint
Jamie Hannaford1ce30f22014-09-16 11:23:34 +020019 th.AssertEquals(t, expected, actual)
20}
21
22func TestAPIInfoURL(t *testing.T) {
Jamie Hannafordc65e1922014-09-22 13:20:58 +020023 actual := apiInfoURL(endpointClient(), "v2.0")
24 expected := endpoint + "v2.0/"
Jamie Hannaford1ce30f22014-09-16 11:23:34 +020025 th.AssertEquals(t, expected, actual)
26}