summary refs log tree commit diff
path: root/tests/utils.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-09-18 18:25:23 +0100
committerErik Johnston <erik@matrix.org>2014-09-18 18:25:23 +0100
commitbeed1ba089fa4aa0aca6ac9ef9c560508197baa4 (patch)
tree51b4105de45a5dea15013b90b2692d772599e302 /tests/utils.py
parentRemove lie from change log. (diff)
parentfix SYWEB-41 (hopefully) (diff)
downloadsynapse-beed1ba089fa4aa0aca6ac9ef9c560508197baa4.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse
Diffstat (limited to 'tests/utils.py')
-rw-r--r--tests/utils.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/utils.py b/tests/utils.py
index d90214e418..bc5d35e56b 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -16,12 +16,14 @@
 from synapse.http.server import HttpServer
 from synapse.api.errors import cs_error, CodeMessageException, StoreError
 from synapse.api.constants import Membership
+from synapse.storage import prepare_database
 
 from synapse.api.events.room import (
     RoomMemberEvent, MessageEvent
 )
 
 from twisted.internet import defer, reactor
+from twisted.enterprise.adbapi import ConnectionPool
 
 from collections import namedtuple
 from mock import patch, Mock
@@ -120,6 +122,18 @@ class MockClock(object):
         self.now += secs
 
 
+class SQLiteMemoryDbPool(ConnectionPool, object):
+    def __init__(self):
+        super(SQLiteMemoryDbPool, self).__init__(
+            "sqlite3", ":memory:",
+            cp_min=1,
+            cp_max=1,
+        )
+
+    def prepare(self):
+        return self.runWithConnection(prepare_database)
+
+
 class MemoryDataStore(object):
 
     Room = namedtuple(