tests/integration: simplify code (#37249)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Claude (Opus 4.7) <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,6 @@ package integration
|
||||
|
||||
import (
|
||||
"archive/tar"
|
||||
"archive/zip"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -16,6 +15,7 @@ import (
|
||||
"code.gitea.io/gitea/models/unittest"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
conda_module "code.gitea.io/gitea/modules/packages/conda"
|
||||
"code.gitea.io/gitea/modules/test"
|
||||
"code.gitea.io/gitea/modules/zstd"
|
||||
"code.gitea.io/gitea/tests"
|
||||
|
||||
@@ -94,11 +94,9 @@ func TestPackageConda(t *testing.T) {
|
||||
io.Copy(zsw, bytes.NewReader(tarContent))
|
||||
zsw.Close()
|
||||
|
||||
var buf bytes.Buffer
|
||||
zpw := zip.NewWriter(&buf)
|
||||
w, _ := zpw.Create("info-x.tar.zst")
|
||||
w.Write(infoBuf.Bytes())
|
||||
zpw.Close()
|
||||
buf := test.WriteZipArchive(map[string]string{
|
||||
"info-x.tar.zst": infoBuf.String(),
|
||||
})
|
||||
|
||||
fullName := channel + "/" + packageName
|
||||
filename := fmt.Sprintf("%s-%s.conda", packageName, packageVersion)
|
||||
|
||||
Reference in New Issue
Block a user