aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/mirror_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-07-07 20:18:18 +0900
committerOphestra <cat@gensokyo.uk>2026-07-07 20:18:18 +0900
commit76360979f9b7898c1e331914b6037b01eab79807 (patch)
tree6955b05d183c72a774b00befc3f4be1c0be11933 /internal/rosa/mirror_test.go
parent6d55ee536e902d059380f79e870d06547627cc7c (diff)
internal/rosa: mirror response write methods
For the fs.FS implementation and static publishing. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/mirror_test.go')
-rw-r--r--internal/rosa/mirror_test.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/internal/rosa/mirror_test.go b/internal/rosa/mirror_test.go
index a671cd31..acd45c39 100644
--- a/internal/rosa/mirror_test.go
+++ b/internal/rosa/mirror_test.go
@@ -4,6 +4,7 @@ import (
"crypto/ed25519"
"io/fs"
"log"
+ "net/http"
"net/http/httptest"
"os"
"testing"
@@ -52,14 +53,16 @@ func TestMirror(t *testing.T) {
}
wantChecksums := pkg.Encode(wantChecksum)
- server := httptest.NewServer(rosa.NewMirror(msg, fstest.MapFS{
+ var mux http.ServeMux
+ rosa.NewMirror(msg, fstest.MapFS{
"identifier/" + ids: {Mode: fs.ModeSymlink | 0777, Data: []byte("../checksum/" + wantChecksums)},
"checksum/" + wantChecksums: {Mode: os.ModeDir | 0500},
- }, priv))
+ }, priv).Register(&mux)
+ server := httptest.NewServer(&mux)
t.Cleanup(server.Close)
var extern pkg.External
- extern, err = rosa.NewRemote("http://example.com:80", pub, server.Client())
+ extern, err = rosa.NewRemote(server.Client(), "http://example.com:80", pub)
if err != nil {
t.Fatal(err)
}