blob: 2a1e6a1a53b7c0b9fdf2eab7064947bf9dd96803 [file] [log] [blame]
Jamie Hannaford4721abc2014-09-16 16:29:04 +02001package extensions
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 TestExtensionURL(t *testing.T) {
Jamie Hannafordc65e1922014-09-22 13:20:58 +020017 actual := extensionURL(endpointClient(), "agent")
18 expected := endpoint + "v2.0/extensions/agent"
Jamie Hannaford1ce30f22014-09-16 11:23:34 +020019 th.AssertEquals(t, expected, actual)
20}
Jamie Hannaford4721abc2014-09-16 16:29:04 +020021
22func TestListExtensionURL(t *testing.T) {
Jamie Hannafordc65e1922014-09-22 13:20:58 +020023 actual := listExtensionURL(endpointClient())
24 expected := endpoint + "v2.0/extensions"
Jamie Hannaford4721abc2014-09-16 16:29:04 +020025 th.AssertEquals(t, expected, actual)
26}