mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 21:34:51 -04:00
Run black.
This commit is contained in:
parent
b37c472419
commit
8b3d9b6b19
75 changed files with 1626 additions and 2277 deletions
|
@ -7,7 +7,6 @@ from tests.utils import setup_test_homeserver
|
|||
|
||||
|
||||
class BackgroundUpdateTestCase(unittest.TestCase):
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def setUp(self):
|
||||
hs = yield setup_test_homeserver() # type: synapse.server.HomeServer
|
||||
|
@ -51,9 +50,7 @@ class BackgroundUpdateTestCase(unittest.TestCase):
|
|||
yield self.store.start_background_update("test_update", {"my_key": 1})
|
||||
|
||||
self.update_handler.reset_mock()
|
||||
result = yield self.store.do_next_background_update(
|
||||
duration_ms * desired_count
|
||||
)
|
||||
result = yield self.store.do_next_background_update(duration_ms * desired_count)
|
||||
self.assertIsNotNone(result)
|
||||
self.update_handler.assert_called_once_with(
|
||||
{"my_key": 1}, self.store.DEFAULT_BACKGROUND_BATCH_SIZE
|
||||
|
@ -67,18 +64,12 @@ class BackgroundUpdateTestCase(unittest.TestCase):
|
|||
|
||||
self.update_handler.side_effect = update
|
||||
self.update_handler.reset_mock()
|
||||
result = yield self.store.do_next_background_update(
|
||||
duration_ms * desired_count
|
||||
)
|
||||
result = yield self.store.do_next_background_update(duration_ms * desired_count)
|
||||
self.assertIsNotNone(result)
|
||||
self.update_handler.assert_called_once_with(
|
||||
{"my_key": 2}, desired_count
|
||||
)
|
||||
self.update_handler.assert_called_once_with({"my_key": 2}, desired_count)
|
||||
|
||||
# third step: we don't expect to be called any more
|
||||
self.update_handler.reset_mock()
|
||||
result = yield self.store.do_next_background_update(
|
||||
duration_ms * desired_count
|
||||
)
|
||||
result = yield self.store.do_next_background_update(duration_ms * desired_count)
|
||||
self.assertIsNone(result)
|
||||
self.assertFalse(self.update_handler.called)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue