MCPcopy Index your code
hub / github.com/docker/docker-agent / TestNewMemoryDatabase

Function TestNewMemoryDatabase

pkg/memory/database/sqlite/sqlite_test.go:35–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestNewMemoryDatabase(t *testing.T) {
36 t.Parallel()
37 db := setupTestDB(t)
38
39 assert.NotNil(t, db, "Database should be created successfully")
40
41 db, err := NewMemoryDatabase("/:invalid:path")
42 require.NoError(t, err, "constructor should not touch the filesystem")
43 err = db.AddMemory(t.Context(), database.UserMemory{ID: "1", CreatedAt: time.Now().Format(time.RFC3339), Memory: "x"})
44 require.Error(t, err, "Should fail with invalid database path")
45}
46
47func TestAddMemory(t *testing.T) {
48 t.Parallel()

Callers

nothing calls this directly

Calls 6

AddMemoryMethod · 0.95
setupTestDBFunction · 0.85
NewMemoryDatabaseFunction · 0.85
ContextMethod · 0.80
NowMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected