MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / newTestConfig

Function newTestConfig

internal/cli/bootstrap_test.go:39–47  ·  view source on GitHub ↗

newTestConfig points DataDir at a fresh tmp dir and BrowserURL at the given test server. Most tests want both wired up together.

(t *testing.T, browserURL string)

Source from the content-addressed store, hash-verified

37// newTestConfig points DataDir at a fresh tmp dir and BrowserURL at the
38// given test server. Most tests want both wired up together.
39func newTestConfig(t *testing.T, browserURL string) *config.Config {
40 t.Helper()
41 cfg := config.DefaultConfig()
42 cfg.DataDir = t.TempDir()
43 // BrowserURL prefers cfg.URL when set, which sidesteps the
44 // host-rewriting branch and gives us a stable URL to assert on.
45 cfg.URL = browserURL
46 return cfg
47}
48
49// writeBootstrapToken drops a token file at <dataDir>/.bootstrap-token in
50// the same shape EnsureBootstrapToken would produce — token + trailing

Calls 1

DefaultConfigFunction · 0.92

Tested by

no test coverage detected