From 1311dbdef0eebf038f583323b1e9ace60f6d60ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 19 Jun 2019 12:01:11 +0200 Subject: [PATCH] tests: Make the indexstore test async. --- tests/store_test.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/store_test.py b/tests/store_test.py index c86a38e..c9a89fb 100644 --- a/tests/store_test.py +++ b/tests/store_test.py @@ -94,21 +94,19 @@ class TestClass(object): assert task not in tasks assert task2 in tasks - def test_new_indexstore(self, tempdir): + async def test_new_indexstore(self, tempdir): loop = asyncio.get_event_loop() store = IndexStore("example", tempdir) store.add_event(self.test_event, TEST_ROOM, None, None) store.add_event(self.another_event, TEST_ROOM, None, None) - loop.run_until_complete(store.commit_events()) + await store.commit_events() assert store.event_in_store(self.test_event.event_id, TEST_ROOM) assert not store.event_in_store("FAKE", TEST_ROOM) - result = loop.run_until_complete( - store.search("test", TEST_ROOM, after_limit=10, before_limit=10) - ) + result = await store.search("test", TEST_ROOM, after_limit=10, before_limit=10) pprint.pprint(result) assert len(result["results"]) == 1