Commit 7b11ecf6 authored by Jérome Perrin's avatar Jérome Perrin Committed by Alain Takoudjou

update tests to not depend on removed archived support

parent 6f80b287
......@@ -755,10 +755,15 @@ func testAuthServer(t *testing.T, url *regexp.Regexp, params url.Values, code in
}
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),
ImageResizerConfig: config.DefaultImageResizerConfig,
}
}
......@@ -914,7 +919,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()
......@@ -984,8 +989,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