diff options
author | Mark Haines <mark.haines@matrix.org> | 2015-11-02 10:57:00 +0000 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2015-11-02 10:57:00 +0000 |
commit | 0e367563838de76972bac1fd7bc3ab3943b9a57e (patch) | |
tree | f3de1ae204fa232033d8951c31a45a71a797d94c /tests | |
parent | Support clients supplying older tokens, fix short poll test (diff) | |
parent | Merge pull request #337 from matrix-org/markjh/v2_sync_joining (diff) | |
download | synapse-0e367563838de76972bac1fd7bc3ab3943b9a57e.tar.xz |
Merge branch 'develop' into markjh/room_tags
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_types.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_types.py b/tests/test_types.py index b29a8415b1..495cd20f02 100644 --- a/tests/test_types.py +++ b/tests/test_types.py @@ -15,13 +15,14 @@ from tests import unittest +from synapse.api.errors import SynapseError from synapse.server import BaseHomeServer from synapse.types import UserID, RoomAlias mock_homeserver = BaseHomeServer(hostname="my.domain") -class UserIDTestCase(unittest.TestCase): +class UserIDTestCase(unittest.TestCase): def test_parse(self): user = UserID.from_string("@1234abcd:my.domain") @@ -29,6 +30,11 @@ class UserIDTestCase(unittest.TestCase): self.assertEquals("my.domain", user.domain) self.assertEquals(True, mock_homeserver.is_mine(user)) + def test_pase_empty(self): + with self.assertRaises(SynapseError): + UserID.from_string("") + + def test_build(self): user = UserID("5678efgh", "my.domain") @@ -44,7 +50,6 @@ class UserIDTestCase(unittest.TestCase): class RoomAliasTestCase(unittest.TestCase): - def test_parse(self): room = RoomAlias.from_string("#channel:my.domain") |