mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-05 23:52:46 +00:00
Add user profile tests, refactor user API methods (#3030)
This adds tests for `/profile`. Also, as a first change in this regard, refactors the methods defined on the `UserInternalAPI` to not use structs as the request/response parameters.
This commit is contained in:
parent
4cb9cd7842
commit
c2db38d295
17 changed files with 391 additions and 258 deletions
|
@ -23,6 +23,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/matrix-org/dendrite/clientapi/auth/authtypes"
|
||||
"github.com/matrix-org/dendrite/cmd/dendrite-demo-yggdrasil/signing"
|
||||
fedAPI "github.com/matrix-org/dendrite/federationapi"
|
||||
fedInternal "github.com/matrix-org/dendrite/federationapi/internal"
|
||||
|
@ -43,8 +44,8 @@ type fakeUserAPI struct {
|
|||
userAPI.FederationUserAPI
|
||||
}
|
||||
|
||||
func (u *fakeUserAPI) QueryProfile(ctx context.Context, req *userAPI.QueryProfileRequest, res *userAPI.QueryProfileResponse) error {
|
||||
return nil
|
||||
func (u *fakeUserAPI) QueryProfile(ctx context.Context, userID string) (*authtypes.Profile, error) {
|
||||
return &authtypes.Profile{}, nil
|
||||
}
|
||||
|
||||
func TestHandleQueryProfile(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue