mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-17 20:03:10 -06:00
roomserver/alias: Get tests passing
Signed-off-by: Serra Allgood <serra@allgood.dev>
This commit is contained in:
parent
da234d4dab
commit
dc935165cc
|
|
@ -44,7 +44,10 @@ func (db MockRoomserverAliasAPIDatabase) RemoveRoomAlias(ctx context.Context, al
|
||||||
}
|
}
|
||||||
|
|
||||||
// This method needs to change depending on test case
|
// This method needs to change depending on test case
|
||||||
func (db MockRoomserverAliasAPIDatabase) GetRoomIDForAlias(ctx context.Context, alias string) (string, error) {
|
func (db *MockRoomserverAliasAPIDatabase) GetRoomIDForAlias(
|
||||||
|
ctx context.Context,
|
||||||
|
alias string,
|
||||||
|
) (string, error) {
|
||||||
switch db.methodModes["GetRoomIDForAlias"] {
|
switch db.methodModes["GetRoomIDForAlias"] {
|
||||||
case "empty":
|
case "empty":
|
||||||
return "", nil
|
return "", nil
|
||||||
|
|
@ -64,7 +67,7 @@ func (db MockRoomserverAliasAPIDatabase) GetRoomIDForAlias(ctx context.Context,
|
||||||
return "", nil
|
return "", nil
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return "", fmt.Errorf("Unknown option used")
|
return "", fmt.Errorf("unknown option used")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -114,7 +117,7 @@ func TestGetRoomIDForAlias(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
setup := func(modes map[string]string) *RoomserverAliasAPI {
|
setup := func(modes map[string]string) *RoomserverAliasAPI {
|
||||||
mockAliasAPIDB := MockRoomserverAliasAPIDatabase{modes, 0}
|
mockAliasAPIDB := &MockRoomserverAliasAPIDatabase{modes, 0}
|
||||||
mockAppServiceQueryAPI := MockAppServiceQueryAPI{modes}
|
mockAppServiceQueryAPI := MockAppServiceQueryAPI{modes}
|
||||||
|
|
||||||
return &RoomserverAliasAPI{
|
return &RoomserverAliasAPI{
|
||||||
Loading…
Reference in a new issue