MCPcopy Create free account
hub / github.com/compozy/agh / mustWriteMemory

Function mustWriteMemory

internal/api/httpapi/memory_test.go:760–778  ·  view source on GitHub ↗
(
	t *testing.T,
	store *memory.Store,
	scope memcontract.Scope,
	workspace string,
	filename string,
	typ memcontract.Type,
	body string,
)

Source from the content-addressed store, hash-verified

758}
759
760func mustWriteMemory(
761 t *testing.T,
762 store *memory.Store,
763 scope memcontract.Scope,
764 workspace string,
765 filename string,
766 typ memcontract.Type,
767 body string,
768) {
769 t.Helper()
770
771 target := store
772 if scope == memcontract.ScopeWorkspace {
773 target = store.ForWorkspace(workspace)
774 }
775 if err := target.Write(scope, filename, []byte(memoryDocument(t, filename, "desc", typ, body))); err != nil {
776 t.Fatalf("Write(%s) error = %v", filename, err)
777 }
778}
779
780func memoryDocument(t *testing.T, name string, description string, typ memcontract.Type, body string) string {
781 t.Helper()

Calls 3

memoryDocumentFunction · 0.70
ForWorkspaceMethod · 0.65
WriteMethod · 0.65

Tested by

no test coverage detected