MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / newTestServer

Function newTestServer

server/mcp/handler_test.go:545–559  ·  view source on GitHub ↗
(sessions map[string]*session)

Source from the content-addressed store, hash-verified

543}
544
545func newTestServer(sessions map[string]*session) *Server {
546 if sessions == nil {
547 sessions = map[string]*session{}
548 }
549 now := time.Now()
550 for _, currentSession := range sessions {
551 if currentSession.createdAt.IsZero() {
552 currentSession.createdAt = now
553 }
554 if currentSession.lastUsedAt.IsZero() {
555 currentSession.lastUsedAt = now
556 }
557 }
558 return &Server{sessions: sessions}
559}
560
561func countSessionsForUser(srv *Server, userID uint) int {
562 count := 0

Calls 1

NowMethod · 0.65

Tested by

no test coverage detected