Add a HomeServer.parse_roomalias() to avoid having to RoomAlias.from_sring(..., hs=hs) - similar to parse_userid()

This commit is contained in:
Paul "LeoNerd" Evans 2014-08-13 17:43:10 +01:00
parent 08ed4ccfdf
commit 7fb93f2a47
4 changed files with 18 additions and 14 deletions

View file

@ -62,3 +62,9 @@ class RoomAliasTestCase(unittest.TestCase):
room = RoomAlias("channel", "my.domain", True)
self.assertEquals(room.to_string(), "#channel:my.domain")
def test_via_homeserver(self):
room = mock_homeserver.parse_roomalias("#elsewhere:my.domain")
self.assertEquals("elsewhere", room.localpart)
self.assertEquals("my.domain", room.domain)