+func TestDownloadChart(t *testing.T) {
+ svr := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ ricdms.Logger.Debug("request received by mock to download chart")
+ reader := strings.NewReader("SAMPLE_RESPONSE")
+ data, _ := io.ReadAll(reader)
+ ricdms.Logger.Debug("writing : %+v", data)
+ w.Write(data)
+ }))
+ svr.Listener.Close()
+ svr.Listener, _ = net.Listen("tcp", ricdms.Config.MockServer)
+
+ svr.Start()
+ defer svr.Close()
+
+ resp := rh.DownloadChart("CHART_NAME", "VERSION")
+ assert.IsType(t, &charts.DownloadHelmChartOK{}, resp, "response did not match type")
+}
+