blob: 7ddfdf21dc9ab935e30af0aaff59d186f32ab1e3 [file] [log] [blame]
Ash Wilson61dcb022014-10-03 08:15:47 -04001package extensions
2
3import (
4 "testing"
5
Jon Perritt27249f42016-02-18 10:35:59 -06006 "github.com/gophercloud/gophercloud"
7 th "github.com/gophercloud/gophercloud/testhelper"
Ash Wilson61dcb022014-10-03 08:15:47 -04008)
9
10const endpoint = "http://localhost:57909/"
11
12func endpointClient() *gophercloud.ServiceClient {
13 return &gophercloud.ServiceClient{Endpoint: endpoint}
14}
15
16func TestExtensionURL(t *testing.T) {
Ash Wilson05e41072014-10-03 16:33:42 -040017 actual := ExtensionURL(endpointClient(), "agent")
Ash Wilsona4931872014-10-03 15:55:35 -040018 expected := endpoint + "extensions/agent"
Ash Wilson61dcb022014-10-03 08:15:47 -040019 th.AssertEquals(t, expected, actual)
20}
21
22func TestListExtensionURL(t *testing.T) {
Ash Wilson05e41072014-10-03 16:33:42 -040023 actual := ListExtensionURL(endpointClient())
Ash Wilsona4931872014-10-03 15:55:35 -040024 expected := endpoint + "extensions"
Ash Wilson61dcb022014-10-03 08:15:47 -040025 th.AssertEquals(t, expected, actual)
26}