diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-08-17 12:18:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-17 12:18:01 -0400 |
commit | 050e20e7ca56c3a5985fdcf64012800c153260f2 (patch) | |
tree | 514cb57562e94f61c70a25c205113b728f0d3178 /tests/storage/test_base.py | |
parent | Use the default templates when a custom template file cannot be found (#8037) (diff) | |
download | synapse-050e20e7ca56c3a5985fdcf64012800c153260f2.tar.xz |
Convert some of the general database methods to async (#8100)
Diffstat (limited to 'tests/storage/test_base.py')
-rw-r--r-- | tests/storage/test_base.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/storage/test_base.py b/tests/storage/test_base.py index efcaeef1e7..13bcac743a 100644 --- a/tests/storage/test_base.py +++ b/tests/storage/test_base.py @@ -66,8 +66,10 @@ class SQLBaseStoreTestCase(unittest.TestCase): def test_insert_1col(self): self.mock_txn.rowcount = 1 - yield self.datastore.db_pool.simple_insert( - table="tablename", values={"columname": "Value"} + yield defer.ensureDeferred( + self.datastore.db_pool.simple_insert( + table="tablename", values={"columname": "Value"} + ) ) self.mock_txn.execute.assert_called_with( @@ -78,10 +80,12 @@ class SQLBaseStoreTestCase(unittest.TestCase): def test_insert_3cols(self): self.mock_txn.rowcount = 1 - yield self.datastore.db_pool.simple_insert( - table="tablename", - # Use OrderedDict() so we can assert on the SQL generated - values=OrderedDict([("colA", 1), ("colB", 2), ("colC", 3)]), + yield defer.ensureDeferred( + self.datastore.db_pool.simple_insert( + table="tablename", + # Use OrderedDict() so we can assert on the SQL generated + values=OrderedDict([("colA", 1), ("colB", 2), ("colC", 3)]), + ) ) self.mock_txn.execute.assert_called_with( |