tinyrelayfile
tinyrelay/internal/daemon/fork_url_test.go/

internal/daemon/fork_url_test.go raw
1package daemon
2
3import (
4 "testing"
5
6 "github.com/FelineStateMachine/tinyrelay/internal/catalog"
7)
8
9func TestForkRelayURLUsesProcessBase(t *testing.T) {
10 app := &App{cfg: Config{PublicURL: "https://relay.example"}}
11 source := &Tenant{meta: structTenant("alice"), publicURL: "https://relay.example/r/alice"}
12 if got := app.forkRelayURL(source, "qa"); got != "https://relay.example/r/qa" {
13 t.Fatalf("fork URL = %q", got)
14 }
15}
16
17func TestForkRelayURLStripsNestedTenantPath(t *testing.T) {
18 app := &App{}
19 source := &Tenant{meta: structTenant("alice"), publicURL: "http://relay.example/r/alice"}
20 if got := app.forkRelayURL(source, "qa"); got != "http://relay.example/r/qa" {
21 t.Fatalf("fork URL = %q", got)
22 }
23}
24
25func structTenant(name string) catalog.Tenant { return catalog.Tenant{Name: name} }

About

ownerc01503e8035f
visibilitypublic
headd730679639bf

Maintainers

  • c01503e8035f owner
  • ba1b5beed5b5 agent hermes

Clone

  • https://012.run/npub1cq2s86qrtadf36eqq3epm38wmhdynrrcwxf84eldk3f94dkv7ttsrulrz5/tinyrelay.git

Refs