Files
mesh-controller/internal/inventory/template_test.go
T
mesh-adminandClaude Opus 5.5 84a75ed2a4
mesh/merge-gate head 84a75ed2a412 merged into trunk fcdecb436117 — fail: head 84a75ed2a412 does not merge cleanly into trunk fcdecb436117: in conflict cmd/…
mesh/repo-check head 84a75ed2a412 merged into trunk fcdecb436117 — fail: head 84a75ed2a412 does not merge cleanly into trunk fcdecb436117: in conflict cmd/…
mesh/delivery superseded: a newer head of the same pull request
Bring F3 up to its release branch, with both sides' store tests (part 13 of 14)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 18:57:37 +00:00

26 lines
1.1 KiB
Go

package inventory
import (
"strings"
"testing"
"github.com/novox/mesh-controller/internal/catalogue"
)
// The manifest the mesh holds carries each file's text (novox/hq ADR 0349 §2): one still naming a template — a
// build by a builder that predates templates, or a manifest handed over unbuilt — would compose a file with no
// text, and is refused by name.
func TestAManifestStillNamingATemplateIsNotRegistered(t *testing.T) {
inv := ForTest(t)
m := catalogue.Manifest{Module: "notifier", Version: "1", Resources: []map[string]any{
{"id": "conf", "type": "file", "path": "/etc/notifier.conf", "template": "files/notifier.conf"}}}
err := inv.RegisterModule(t.Context(), m, Source{})
if err == nil || !strings.Contains(err.Error(), "files/notifier.conf") {
t.Fatalf("a manifest naming a template was registered: %v", err)
}
m.Resources[0] = map[string]any{"id": "conf", "type": "file", "path": "/etc/notifier.conf", "content": "x"}
if err := inv.RegisterModule(t.Context(), m, Source{}); err != nil {
t.Fatalf("the same manifest with its text was refused: %v", err)
}
}