Commit d5fd75fe authored by Sushil Kumar's avatar Sushil Kumar

Updated StartLocalServerForTests to be private method

parent dce9d88c
...@@ -190,8 +190,8 @@ func verifyIndex(t *testing.T, actual *IndexFile) { ...@@ -190,8 +190,8 @@ func verifyIndex(t *testing.T, actual *IndexFile) {
} }
} }
// StartLocalServerForTests Start the local helm server // startLocalServerForTests Start the local helm server
func StartLocalServerForTests(handler http.Handler) (*httptest.Server, error) { func startLocalServerForTests(handler http.Handler) (*httptest.Server, error) {
if handler == nil { if handler == nil {
fileBytes, err := ioutil.ReadFile("testdata/local-index.yaml") fileBytes, err := ioutil.ReadFile("testdata/local-index.yaml")
if err != nil { if err != nil {
...@@ -206,7 +206,7 @@ func StartLocalServerForTests(handler http.Handler) (*httptest.Server, error) { ...@@ -206,7 +206,7 @@ func StartLocalServerForTests(handler http.Handler) (*httptest.Server, error) {
} }
func TestFindChartInRepoURL(t *testing.T) { func TestFindChartInRepoURL(t *testing.T) {
srv, err := StartLocalServerForTests(nil) srv, err := startLocalServerForTests(nil)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
...@@ -238,7 +238,7 @@ func TestErrorFindChartInRepoURL(t *testing.T) { ...@@ -238,7 +238,7 @@ func TestErrorFindChartInRepoURL(t *testing.T) {
t.Errorf("Expected error for bad chart URL, but got a different error (%v)", err) t.Errorf("Expected error for bad chart URL, but got a different error (%v)", err)
} }
srv, err := StartLocalServerForTests(nil) srv, err := startLocalServerForTests(nil)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
......
...@@ -129,7 +129,7 @@ func TestMerge(t *testing.T) { ...@@ -129,7 +129,7 @@ func TestMerge(t *testing.T) {
} }
func TestDownloadIndexFile(t *testing.T) { func TestDownloadIndexFile(t *testing.T) {
srv, err := StartLocalServerForTests(nil) srv, err := startLocalServerForTests(nil)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
......
...@@ -42,7 +42,7 @@ func TestRepositoryServer(t *testing.T) { ...@@ -42,7 +42,7 @@ func TestRepositoryServer(t *testing.T) {
} }
s := &RepositoryServer{RepoPath: "testdata/server"} s := &RepositoryServer{RepoPath: "testdata/server"}
srv, err := StartLocalServerForTests(s) srv, err := startLocalServerForTests(s)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment