MCPcopy
hub / github.com/usememos/memos / TestAttachmentInvalidUID

Function TestAttachmentInvalidUID

store/test/attachment_test.go:287–305  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

285}
286
287func TestAttachmentInvalidUID(t *testing.T) {
288 t.Parallel()
289 ctx := context.Background()
290 ts := NewTestingStore(ctx, t)
291
292 // Create with invalid UID (contains spaces)
293 _, err := ts.CreateAttachment(ctx, &store.Attachment{
294 UID: "invalid uid with spaces",
295 CreatorID: 101,
296 Filename: "test.png",
297 Blob: []byte("test"),
298 Type: "image/png",
299 Size: 1000,
300 })
301 require.Error(t, err)
302 require.Contains(t, err.Error(), "invalid uid")
303
304 ts.Close()
305}

Callers

nothing calls this directly

Calls 4

NewTestingStoreFunction · 0.85
CreateAttachmentMethod · 0.65
ErrorMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected