Commit d017682b authored by Jérome Perrin's avatar Jérome Perrin

update tests to not depend on removed archived support

parent 2ad58e73
......@@ -523,10 +523,15 @@ func testAuthServer(url *regexp.Regexp, code int, body interface{}) *httptest.Se
}
func newUpstreamConfig(authBackend string) *config.Config {
cwd, err := os.Getwd()
if err != nil {
panic(err)
}
return &config.Config{
Version: "123",
DocumentRoot: testDocumentRoot,
Backend: helper.URLMustParse(authBackend),
RepoPath: path.Join(cwd, testRepoRoot),
}
}
......@@ -685,7 +690,7 @@ func (dl DownloadContext) ExpectHeader(path, header, value string) {
func TestBlobDownload(t *testing.T) {
// Prepare test server and "all-ok" auth backend
ts := archiveOKServer(t, "")
ts := testhelper.TestServerWithHandler(regexp.MustCompile("."), func(w http.ResponseWriter, r *http.Request) {})
defer ts.Close()
ws := startWorkhorseServer(ts.URL)
defer ws.Close()
......@@ -755,8 +760,8 @@ func TestPrivateBlobDownload(t *testing.T) {
return
}
// for authorized .../repository/archive.zip reply the same way archiveOKServer does.
aok := archiveOKServer(t, "")
// for authorized .../repository/archive.zip reply with 200 OK
aok := testhelper.TestServerWithHandler(regexp.MustCompile("."), func(w http.ResponseWriter, r *http.Request) {})
defer aok.Close()
aokurl, err := url.Parse(aok.URL)
if err != nil {
......
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