23 lines
382 B
Go
23 lines
382 B
Go
package mcp_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gitea.d-ma.be/mathias/gitea-mcp/internal/mcp"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestSessionStoreIssueAndCheck(t *testing.T) {
|
|
s := mcp.NewSessionStore()
|
|
|
|
id := s.Issue()
|
|
assert.NotEmpty(t, id)
|
|
assert.Len(t, id, 32)
|
|
|
|
assert.True(t, s.Valid(id))
|
|
assert.False(t, s.Valid("bogus"))
|
|
|
|
s.Drop(id)
|
|
assert.False(t, s.Valid(id))
|
|
}
|