Harden inbox JSON validation and claim conflicts
This commit is contained in:
@@ -608,14 +608,28 @@ func TestInboxJSONErrorsAndExitCodes(t *testing.T) {
|
||||
"send",
|
||||
"--from", "leader",
|
||||
"--to", "worker-z",
|
||||
"--subject", "Invalid body flags",
|
||||
"--body", "inline",
|
||||
"--body-file", filepath.Join(t.TempDir(), "missing.md"),
|
||||
"--subject", "Invalid payload json",
|
||||
"--payload-json", "not-json",
|
||||
)
|
||||
if exitCode != 30 {
|
||||
t.Fatalf("expected invalid input exit code 30, got %d", exitCode)
|
||||
}
|
||||
assertErrorJSON(t, stdout, "invalid_input")
|
||||
|
||||
stdout, _, exitCode = executeInboxCommand(
|
||||
"--db", dbPath,
|
||||
"--json",
|
||||
"send",
|
||||
"--from", "leader",
|
||||
"--to", "worker-z",
|
||||
"--subject", "Invalid artifact json",
|
||||
"--artifact", "/tmp/report.md",
|
||||
"--artifact-metadata-json", "not-json",
|
||||
)
|
||||
if exitCode != 30 {
|
||||
t.Fatalf("expected invalid artifact metadata exit code 30, got %d", exitCode)
|
||||
}
|
||||
assertErrorJSON(t, stdout, "invalid_input")
|
||||
}
|
||||
|
||||
func runInboxCommand(t *testing.T, args ...string) string {
|
||||
|
||||
Reference in New Issue
Block a user