From f8830413c0866ce9e05a0d9011f3192463a48c6a Mon Sep 17 00:00:00 2001 From: Sebastian Riese Date: Fri, 11 Feb 2022 14:27:45 +0100 Subject: [PATCH] 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 --- rgw/admin/utils_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rgw/admin/utils_test.go b/rgw/admin/utils_test.go index cd6d5fb..9333183 100644 --- a/rgw/admin/utils_test.go +++ b/rgw/admin/utils_test.go @@ -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) {