summary refs log tree commit diff
path: root/tests/storage
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-01-23 11:47:15 +0000
committerMark Haines <mark.haines@matrix.org>2015-01-23 11:47:15 +0000
commit5759bec43cb52862a8d455afb8cd9d1c5660bc3d (patch)
treeb8faefa2249086e8d9c8a846b442582e98ca873e /tests/storage
parentMerge pull request #31 from matrix-org/client_api_resource (diff)
downloadsynapse-5759bec43cb52862a8d455afb8cd9d1c5660bc3d.tar.xz
Replace hs.parse_userid with UserID.from_string
Diffstat (limited to 'tests/storage')
-rw-r--r--tests/storage/test_presence.py5
-rw-r--r--tests/storage/test_profile.py3
-rw-r--r--tests/storage/test_redaction.py5
-rw-r--r--tests/storage/test_room.py3
-rw-r--r--tests/storage/test_roommember.py7
-rw-r--r--tests/storage/test_stream.py5
6 files changed, 17 insertions, 11 deletions
diff --git a/tests/storage/test_presence.py b/tests/storage/test_presence.py
index 9655d3cf42..1ab193736b 100644
--- a/tests/storage/test_presence.py
+++ b/tests/storage/test_presence.py
@@ -19,6 +19,7 @@ from twisted.internet import defer
 
 from synapse.server import HomeServer
 from synapse.storage.presence import PresenceStore
+from synapse.types import UserID
 
 from tests.utils import SQLiteMemoryDbPool, MockClock
 
@@ -37,8 +38,8 @@ class PresenceStoreTestCase(unittest.TestCase):
 
         self.store = PresenceStore(hs)
 
-        self.u_apple = hs.parse_userid("@apple:test")
-        self.u_banana = hs.parse_userid("@banana:test")
+        self.u_apple = UserID.from_string("@apple:test")
+        self.u_banana = UserID.from_string("@banana:test")
 
     @defer.inlineCallbacks
     def test_state(self):
diff --git a/tests/storage/test_profile.py b/tests/storage/test_profile.py
index 5d36723c28..84381241bc 100644
--- a/tests/storage/test_profile.py
+++ b/tests/storage/test_profile.py
@@ -19,6 +19,7 @@ from twisted.internet import defer
 
 from synapse.server import HomeServer
 from synapse.storage.profile import ProfileStore
+from synapse.types import UserID
 
 from tests.utils import SQLiteMemoryDbPool
 
@@ -36,7 +37,7 @@ class ProfileStoreTestCase(unittest.TestCase):
 
         self.store = ProfileStore(hs)
 
-        self.u_frank = hs.parse_userid("@frank:test")
+        self.u_frank = UserID.from_string("@frank:test")
 
     @defer.inlineCallbacks
     def test_displayname(self):
diff --git a/tests/storage/test_redaction.py b/tests/storage/test_redaction.py
index 9806fbc69b..a16ccad881 100644
--- a/tests/storage/test_redaction.py
+++ b/tests/storage/test_redaction.py
@@ -19,6 +19,7 @@ from twisted.internet import defer
 
 from synapse.server import HomeServer
 from synapse.api.constants import EventTypes, Membership
+from synapse.types import UserID
 
 from tests.utils import SQLiteMemoryDbPool, MockKey
 
@@ -48,8 +49,8 @@ class RedactionTestCase(unittest.TestCase):
         self.handlers = hs.get_handlers()
         self.message_handler = self.handlers.message_handler
 
-        self.u_alice = hs.parse_userid("@alice:test")
-        self.u_bob = hs.parse_userid("@bob:test")
+        self.u_alice = UserID.from_string("@alice:test")
+        self.u_bob = UserID.from_string("@bob:test")
 
         self.room1 = hs.parse_roomid("!abc123:test")
 
diff --git a/tests/storage/test_room.py b/tests/storage/test_room.py
index e7739776ec..c6bfde069a 100644
--- a/tests/storage/test_room.py
+++ b/tests/storage/test_room.py
@@ -19,6 +19,7 @@ from twisted.internet import defer
 
 from synapse.server import HomeServer
 from synapse.api.constants import EventTypes
+from synapse.types import UserID
 
 from tests.utils import SQLiteMemoryDbPool
 
@@ -40,7 +41,7 @@ class RoomStoreTestCase(unittest.TestCase):
 
         self.room = hs.parse_roomid("!abcde:test")
         self.alias = hs.parse_roomalias("#a-room-name:test")
-        self.u_creator = hs.parse_userid("@creator:test")
+        self.u_creator = UserID.from_string("@creator:test")
 
         yield self.store.store_room(self.room.to_string(),
             room_creator_user_id=self.u_creator.to_string(),
diff --git a/tests/storage/test_roommember.py b/tests/storage/test_roommember.py
index a23a8189df..6b7930b1d8 100644
--- a/tests/storage/test_roommember.py
+++ b/tests/storage/test_roommember.py
@@ -19,6 +19,7 @@ from twisted.internet import defer
 
 from synapse.server import HomeServer
 from synapse.api.constants import EventTypes, Membership
+from synapse.types import UserID
 
 from tests.utils import SQLiteMemoryDbPool, MockKey
 
@@ -49,11 +50,11 @@ class RoomMemberStoreTestCase(unittest.TestCase):
         self.handlers = hs.get_handlers()
         self.message_handler = self.handlers.message_handler
 
-        self.u_alice = hs.parse_userid("@alice:test")
-        self.u_bob = hs.parse_userid("@bob:test")
+        self.u_alice = UserID.from_string("@alice:test")
+        self.u_bob = UserID.from_string("@bob:test")
 
         # User elsewhere on another host
-        self.u_charlie = hs.parse_userid("@charlie:elsewhere")
+        self.u_charlie = UserID.from_string("@charlie:elsewhere")
 
         self.room = hs.parse_roomid("!abc123:test")
 
diff --git a/tests/storage/test_stream.py b/tests/storage/test_stream.py
index 9247fc579e..d7c7f64d5e 100644
--- a/tests/storage/test_stream.py
+++ b/tests/storage/test_stream.py
@@ -19,6 +19,7 @@ from twisted.internet import defer
 
 from synapse.server import HomeServer
 from synapse.api.constants import EventTypes, Membership
+from synapse.types import UserID
 
 from tests.utils import SQLiteMemoryDbPool, MockKey
 
@@ -48,8 +49,8 @@ class StreamStoreTestCase(unittest.TestCase):
         self.handlers = hs.get_handlers()
         self.message_handler = self.handlers.message_handler
 
-        self.u_alice = hs.parse_userid("@alice:test")
-        self.u_bob = hs.parse_userid("@bob:test")
+        self.u_alice = UserID.from_string("@alice:test")
+        self.u_bob = UserID.from_string("@bob:test")
 
         self.room1 = hs.parse_roomid("!abc123:test")
         self.room2 = hs.parse_roomid("!xyx987:test")