def test_set_my_name(self): yield self.handler.set_displayname(self.frank, requester_for_user(self.frank), "Frank Jr.") self.assertEquals( (yield self.store.get_profile_displayname(self.frank.localpart)), "Frank Jr.")
def test_set_my_avatar(self): yield self.handler.set_avatar_url(self.frank, requester_for_user(self.frank), "http://my.server/pic.gif") self.assertEquals( (yield self.store.get_profile_avatar_url(self.frank.localpart)), "http://my.server/pic.gif")
def test_set_my_name_noauth(self): d = self.handler.set_displayname( self.frank, requester_for_user(self.bob), "Frank Jr." ) yield self.assertFailure(d, AuthError)
def test_set_my_avatar(self): yield self.handler.set_avatar_url( self.frank, requester_for_user(self.frank), "http://my.server/pic.gif" ) self.assertEquals( (yield self.store.get_profile_avatar_url(self.frank.localpart)), "http://my.server/pic.gif" )
def test_set_my_name(self): yield self.handler.set_displayname( self.frank, requester_for_user(self.frank), "Frank Jr." ) self.assertEquals( (yield self.store.get_profile_displayname(self.frank.localpart)), "Frank Jr." )
def send_text_message(self, room_id, message): handler = self.hs.get_handlers().message_handler event = yield handler.create_and_send_nonmember_event( requester_for_user(self.user), { "type": "m.room.message", "content": {"body": "message", "msgtype": "m.text"}, "room_id": room_id, "sender": self.user.to_string(), }, ) defer.returnValue(event.event_id)
def send_text_message(self, room_id, message): handler = self.hs.get_handlers().message_handler event = yield handler.create_and_send_nonmember_event( requester_for_user(self.user), { "type": "m.room.message", "content": { "body": "message", "msgtype": "m.text" }, "room_id": room_id, "sender": self.user.to_string(), }) defer.returnValue(event.event_id)
def test_set_my_name_noauth(self): d = self.handler.set_displayname(self.frank, requester_for_user(self.bob), "Frank Jr.") yield self.assertFailure(d, AuthError)