mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 02:54:52 -04:00
Add database config class (#6513)
This encapsulates config for a given database and is the way to get new connections.
This commit is contained in:
parent
91ccfe9f37
commit
2284eb3a53
19 changed files with 286 additions and 208 deletions
|
@ -52,15 +52,17 @@ class SQLBaseStoreTestCase(unittest.TestCase):
|
|||
config = Mock()
|
||||
config._disable_native_upserts = True
|
||||
config.event_cache_size = 1
|
||||
config.database_config = {"name": "sqlite3"}
|
||||
engine = create_engine(config.database_config)
|
||||
hs = TestHomeServer("test", config=config)
|
||||
|
||||
sqlite_config = {"name": "sqlite3"}
|
||||
engine = create_engine(sqlite_config)
|
||||
fake_engine = Mock(wraps=engine)
|
||||
fake_engine.can_native_upsert = False
|
||||
hs = TestHomeServer(
|
||||
"test", db_pool=self.db_pool, config=config, database_engine=fake_engine
|
||||
)
|
||||
|
||||
self.datastore = SQLBaseStore(Database(hs), None, hs)
|
||||
db = Database(Mock(), Mock(config=sqlite_config), fake_engine)
|
||||
db._db_pool = self.db_pool
|
||||
|
||||
self.datastore = SQLBaseStore(db, None, hs)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def test_insert_1col(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue