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

Function assertShellRefusal

internal/server/plan_limit_native_shell_test.go:60–80  ·  view source on GitHub ↗
(t *testing.T, msg string, details map[string]any, shell bool)

Source from the content-addressed store, hash-verified

58}
59
60func assertShellRefusal(t *testing.T, msg string, details map[string]any, shell bool) {
61 t.Helper()
62 _, has := details["upgrade_url"]
63 if shell && has {
64 t.Errorf("shell request: details carry upgrade_url %v, want absent", details["upgrade_url"])
65 }
66 if !shell && !has {
67 t.Errorf("browser request: details lack upgrade_url, want /settings/billing (details=%v)", details)
68 }
69 if details["feature"] == nil || details["limit"] == nil {
70 t.Errorf("details lost the refusal's facts: %v", details)
71 }
72 if shell {
73 low := strings.ToLower(msg)
74 for _, w := range upgradeWords {
75 if strings.Contains(low, w) {
76 t.Errorf("shell message %q contains %q", msg, w)
77 }
78 }
79 }
80}
81
82func TestPlanLimit_NativeShell_SingleDoor(t *testing.T) {
83 t.Parallel()

Calls 1

HelperMethod · 0.80

Tested by

no test coverage detected