mirror of https://github.com/ceph/go-ceph
rgw/admin: Extend the testing of buildQueryPath
Only one of the two code paths of buildQueryPath was tested so far. This makes the test harness tight by testing the second one (where the path already contains a query parameter). Signed-off-by: Sebastian Riese <sebastian.riese@cloudandheat.com>
This commit is contained in:
parent
1de6083536
commit
f8830413c0
|
@ -18,6 +18,9 @@ func getDefaultValue() url.Values {
|
|||
func TestBuildQueryPath(t *testing.T) {
|
||||
queryPath := buildQueryPath("http://192.168.0.1", "/user", getDefaultValue().Encode())
|
||||
assert.Equal(t, "http://192.168.0.1/admin/user?format=json", queryPath)
|
||||
|
||||
queryPath = buildQueryPath("http://192.168.0.1", "/user?foo", getDefaultValue().Encode())
|
||||
assert.Equal(t, "http://192.168.0.1/admin/user?foo&format=json", queryPath)
|
||||
}
|
||||
|
||||
func TestValueToURLParams(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue