MCPcopy Create free account
hub / github.com/astercloud/aster / TestInMemoryService_Delete

Function TestInMemoryService_Delete

pkg/session/inmemory_test.go:189–216  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

187}
188
189func TestInMemoryService_Delete(t *testing.T) {
190 t.Skip("Skipping: inmemory service implementation has issues with error handling")
191 ctx := context.Background()
192
193 t.Run("删除存在的会话", func(t *testing.T) {
194 service := NewInMemoryService()
195 sess, _ := service.Create(ctx, &CreateRequest{
196 AppName: "test-app",
197 UserID: "user-1",
198 AgentID: "agent-1",
199 })
200
201 err := service.Delete(ctx, sess.ID())
202 require.NoError(t, err)
203
204 // 验证已删除
205 _, err = service.Get(ctx, &GetRequest{
206 SessionID: sess.ID(),
207 })
208 assert.ErrorIs(t, err, ErrSessionNotFound)
209 })
210
211 t.Run("删除不存在的会话", func(t *testing.T) {
212 service := NewInMemoryService()
213 err := service.Delete(ctx, "non-existent-id")
214 assert.ErrorIs(t, err, ErrSessionNotFound)
215 })
216}
217
218func TestInMemoryService_AppendEvent(t *testing.T) {
219 ctx := context.Background()

Callers

nothing calls this directly

Calls 6

CreateMethod · 0.95
DeleteMethod · 0.95
GetMethod · 0.95
NewInMemoryServiceFunction · 0.85
IDMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected