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