This repository was archived by the owner on Aug 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
openstack/blockstorage/v1/apiversions Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package apiversions
2
2
3
3
import (
4
4
"strings"
5
+ "net/url"
5
6
6
7
"github.com/rackspace/gophercloud"
7
8
)
@@ -11,5 +12,7 @@ func getURL(c *gophercloud.ServiceClient, version string) string {
11
12
}
12
13
13
14
func listURL (c * gophercloud.ServiceClient ) string {
14
- return c .ServiceURL ("" )
15
+ u , _ := url .Parse (c .ServiceURL ("" ))
16
+ u .Path = "/"
17
+ return u .String ()
15
18
}
Original file line number Diff line number Diff line change @@ -8,19 +8,24 @@ import (
8
8
)
9
9
10
10
const endpoint = "http://localhost:57909/"
11
+ const endpoint2 = "http://localhost:57909/v1/3a02ee0b5cf14816b41b17e851d29a94"
11
12
12
13
func endpointClient () * gophercloud.ServiceClient {
13
14
return & gophercloud.ServiceClient {Endpoint : endpoint }
14
15
}
15
16
17
+ func endpointClient2 () * gophercloud.ServiceClient {
18
+ return & gophercloud.ServiceClient {Endpoint : endpoint2 }
19
+ }
20
+
16
21
func TestGetURL (t * testing.T ) {
17
22
actual := getURL (endpointClient (), "v1" )
18
23
expected := endpoint + "v1/"
19
24
th .AssertEquals (t , expected , actual )
20
25
}
21
26
22
27
func TestListURL (t * testing.T ) {
23
- actual := listURL (endpointClient ())
28
+ actual := listURL (endpointClient2 ())
24
29
expected := endpoint
25
30
th .AssertEquals (t , expected , actual )
26
31
}
You can’t perform that action at this time.
0 commit comments