This commit is contained in:
Sam Wedgwood 2023-08-16 16:48:01 +01:00
parent 67e2c81aa7
commit df128b5bcb

View file

@ -3,6 +3,7 @@ package routing
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"fmt"
"net/http" "net/http"
"testing" "testing"
@ -29,6 +30,15 @@ type testRoomserverAPI struct {
senderMapping map[string]string senderMapping map[string]string
} }
func (s testRoomserverAPI) QueryRoomVersionForRoom(ctx context.Context, roomID string) (gomatrixserverlib.RoomVersion, error) {
if roomID == s.roomIDStr {
return s.roomVersion, nil
} else {
s.t.Logf("room version queried for %s", roomID)
return "", fmt.Errorf("unknown room")
}
}
func (s testRoomserverAPI) QueryLatestEventsAndState( func (s testRoomserverAPI) QueryLatestEventsAndState(
ctx context.Context, ctx context.Context,
req *rsapi.QueryLatestEventsAndStateRequest, req *rsapi.QueryLatestEventsAndStateRequest,