mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 10:33:11 -06:00
Test RoomInfoByNID
This commit is contained in:
parent
9a27511b24
commit
20c3471a2b
|
|
@ -278,6 +278,16 @@ func TestPurgeRoom(t *testing.T) {
|
|||
if roomInfo == nil {
|
||||
t.Fatalf("room does not exist")
|
||||
}
|
||||
|
||||
//
|
||||
roomInfo2, err := db.RoomInfoByNID(ctx, roomInfo.RoomNID)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !reflect.DeepEqual(roomInfo, roomInfo2) {
|
||||
t.Fatalf("expected roomInfos to be the same, but they aren't")
|
||||
}
|
||||
|
||||
// remember the roomInfo before purging
|
||||
existingRoomInfo := roomInfo
|
||||
|
||||
|
|
@ -333,6 +343,10 @@ func TestPurgeRoom(t *testing.T) {
|
|||
if roomInfo != nil {
|
||||
t.Fatalf("room should not exist after purging: %+v", roomInfo)
|
||||
}
|
||||
roomInfo2, err = db.RoomInfoByNID(ctx, existingRoomInfo.RoomNID)
|
||||
if err == nil {
|
||||
t.Fatalf("expected room to not exist, but it does: %#v", roomInfo2)
|
||||
}
|
||||
|
||||
// validation below
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue