Chore: Code cleaning with unit tests in promlib (#99542)

* update request tests

* remove unused functions

* add unit tests

* remove commented code

* fix unit tests
This commit is contained in:
ismail simsek
2025-01-31 10:39:08 +01:00
committed by GitHub
parent 3b231c433f
commit ec836f2760
6 changed files with 177 additions and 60 deletions

View File

@@ -43,7 +43,7 @@ func BenchmarkExemplarJson(b *testing.B) {
StatusCode: 200,
Body: io.NopCloser(bytes.NewReader(responseBytes)),
}
tCtx.httpProvider.setResponse(&res)
tCtx.httpProvider.setResponse(&res, &res)
resp, err := tCtx.queryData.Execute(context.Background(), query)
require.NoError(b, err)
for _, r := range resp.Responses {
@@ -74,7 +74,7 @@ func BenchmarkRangeJson(b *testing.B) {
StatusCode: 200,
Body: io.NopCloser(bytes.NewReader(body)),
}
tCtx.httpProvider.setResponse(&res)
tCtx.httpProvider.setResponse(&res, &res)
r, err = tCtx.queryData.Execute(context.Background(), q)
require.NoError(b, err)
}