mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-21 13:03:09 -06:00
Add almost useless test
This commit is contained in:
parent
84b3348cad
commit
e90bf83db0
29
keyserver/keyserver_test.go
Normal file
29
keyserver/keyserver_test.go
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
package keyserver
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
roomserver "github.com/matrix-org/dendrite/roomserver/api"
|
||||||
|
"github.com/matrix-org/dendrite/test"
|
||||||
|
"github.com/matrix-org/dendrite/test/testrig"
|
||||||
|
)
|
||||||
|
|
||||||
|
type mockKeyserverRoomserverAPI struct {
|
||||||
|
leftUsers []string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *mockKeyserverRoomserverAPI) QueryLeftUsers(ctx context.Context, req *roomserver.QueryLeftUsersRequest, res *roomserver.QueryLeftUsersResponse) error {
|
||||||
|
res.LeftUsers = m.leftUsers
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Merely tests that we can create an internal keyserver API
|
||||||
|
func Test_NewInternalAPI(t *testing.T) {
|
||||||
|
rsAPI := &mockKeyserverRoomserverAPI{}
|
||||||
|
test.WithAllDatabases(t, func(t *testing.T, dbType test.DBType) {
|
||||||
|
base, closeBase := testrig.CreateBaseDendrite(t, dbType)
|
||||||
|
defer closeBase()
|
||||||
|
_ = NewInternalAPI(base, &base.Cfg.KeyServer, nil, rsAPI)
|
||||||
|
})
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue