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

Function createTestCollection

internal/store/items_test.go:14–24  ·  view source on GitHub ↗

--- Collection helpers ---

(t *testing.T, s *Store, workspaceID, name string)

Source from the content-addressed store, hash-verified

12// --- Collection helpers ---
13
14func createTestCollection(t *testing.T, s *Store, workspaceID, name string) *models.Collection {
15 t.Helper()
16 col, err := s.CreateCollection(workspaceID, models.CollectionCreate{
17 Name: name,
18 Schema: `{"fields":[{"key":"status","label":"Status","type":"select","options":["open","done"],"default":"open","required":true}]}`,
19 })
20 if err != nil {
21 t.Fatalf("failed to create collection: %v", err)
22 }
23 return col
24}
25
26func createTestItem(t *testing.T, s *Store, workspaceID, collectionID, title, content string) *models.Item {
27 t.Helper()

Calls 1

CreateCollectionMethod · 0.45

Tested by

no test coverage detected