blob: 68cfb8ca055e0e61a51babd510f112ff28cef129 [file] [log] [blame]
Jon Perrittfd53bba2014-10-03 00:41:22 -05001package apiversions
2
3import (
4 "testing"
5
6 "github.com/rackspace/gophercloud"
7 th "github.com/rackspace/gophercloud/testhelper"
8)
9
10const endpoint = "http://localhost:57909/"
Marcin Krolik14c88012016-02-16 08:59:48 +010011const endpoint2 = "http://localhost:57909/v1/3a02ee0b5cf14816b41b17e851d29a94"
Jon Perrittfd53bba2014-10-03 00:41:22 -050012
13func endpointClient() *gophercloud.ServiceClient {
14 return &gophercloud.ServiceClient{Endpoint: endpoint}
15}
16
Marcin Krolik14c88012016-02-16 08:59:48 +010017func endpointClient2() *gophercloud.ServiceClient {
18 return &gophercloud.ServiceClient{Endpoint: endpoint2}
19}
20
Jon Perrittfd53bba2014-10-03 00:41:22 -050021func TestGetURL(t *testing.T) {
22 actual := getURL(endpointClient(), "v1")
23 expected := endpoint + "v1/"
24 th.AssertEquals(t, expected, actual)
25}
26
27func TestListURL(t *testing.T) {
Marcin Krolik14c88012016-02-16 08:59:48 +010028 actual := listURL(endpointClient2())
Jon Perrittfd53bba2014-10-03 00:41:22 -050029 expected := endpoint
30 th.AssertEquals(t, expected, actual)
31}