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:
Sebastian Riese 2022-02-11 14:27:45 +01:00 committed by mergify[bot]
parent 1de6083536
commit f8830413c0
1 changed files with 3 additions and 0 deletions

View File

@ -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) {