def test_room_avatar_event(self): room = self.test_room assert not room.gen_avatar_url room.handle_event( RoomAvatarEvent( { "event_id": "event_id", "sender": BOB_ID, "origin_server_ts": 0 }, "mxc://foo")) assert room.gen_avatar_url == "mxc://foo"
def test_room_avatar_event_no_url(self): parsed_dict = TestClass._load_response("tests/data/events/room_avatar.json") parsed_dict["content"].pop("url") event = RoomAvatarEvent.from_dict(parsed_dict) assert isinstance(event, BadEvent)
def test_room_avatar_event(self): parsed_dict = TestClass._load_response("tests/data/events/room_avatar.json") event = RoomAvatarEvent.from_dict(parsed_dict) assert isinstance(event, RoomAvatarEvent)