From a9f16826349aaea3eff018dcb5ca0bc8e2fd0c3f Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Wed, 3 Jul 2024 20:53:17 -0400 Subject: [PATCH] fix(test): ajuster TLS client voki selon config --- client_test.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client_test.go b/client_test.go index a2aea93..3e1f180 100644 --- a/client_test.go +++ b/client_test.go @@ -22,7 +22,15 @@ func TestAPI(t *testing.T) { httpClient := http.DefaultClient defer httpClient.CloseIdleConnections() - vokiClient := voki.New(httpClient, "localhost", cfg.API.Key, cfg.API.Port, "http") + var protocol string + switch cfg.API.TLS.Enabled { + case true: + protocol = "https" + case false: + protocol = "http" + } + + vokiClient := voki.New(httpClient, "localhost", cfg.API.Key, cfg.API.Port, protocol) apiClient := APIClient{vokiClient} t.Run("get API health", func(t *testing.T) {