update tests and memory implementation to follow real DB implementations as much as possible. Fix the tests to let the DB generate the server uuids rather than setting them up in the test.
This commit is contained in:
parent
d0a0adf620
commit
f9ab0bc49b
1 changed files with 118 additions and 125 deletions
|
|
@ -7,6 +7,7 @@ import (
|
|||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/modelcontextprotocol/registry/internal/model"
|
||||
)
|
||||
|
||||
|
|
@ -231,6 +232,8 @@ func (db *MemoryDB) Publish(ctx context.Context, serverDetail *model.ServerDetai
|
|||
return ErrInvalidInput
|
||||
}
|
||||
|
||||
// Generate a new ID for the server detail
|
||||
serverDetail.ID = uuid.New().String()
|
||||
// Store a copy of the entire ServerDetail
|
||||
serverDetailCopy := *serverDetail
|
||||
db.entries[serverDetail.ID] = &serverDetailCopy
|
||||
|
|
|
|||
Loading…
Reference in a new issue