Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NewClientTester = func(t *testing.T, repo *api.Repo, emptyIndex bool, indexFile string) ClientTester { switch repo.Kind { case api.Kind_CHARTMUSEUM: return chartmuseum.NewTester(t, repo, emptyIndex, indexFile) default: t.Errorf("unsupported repo kind %q", repo.Kind) return nil } }
NewClientTester returns a fake repo for testing purposes
The func is exposed as a var to allow tests to temporarily replace its implementation, e.g. to return a fake.
Functions ¶
Types ¶
type ClientTester ¶
type ClientTester interface { ServeHTTP(w http.ResponseWriter, r *http.Request) GetChart(w http.ResponseWriter, r *http.Request, chart string) GetIndex(w http.ResponseWriter, r *http.Request, emptyIndex bool, indexFile string) GetChartPackage(w http.ResponseWriter, r *http.Request, chartPackageName string) PostChart(w http.ResponseWriter, r *http.Request) GetURL() string }
ClientTester defines the methods that a fake tester should implement
Click to show internal directories.
Click to hide internal directories.