mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-08 00:45:00 -04:00
Make ObservableDeferred.observe() always return deferred.
This makes it easier to use in an async/await world. Also fixes a bug where cache descriptors would occaisonally return a raw value rather than a deferred.
This commit is contained in:
parent
46c12918ad
commit
326b3dace7
3 changed files with 5 additions and 8 deletions
|
@ -310,14 +310,14 @@ class DescriptorTestCase(unittest.TestCase):
|
|||
|
||||
obj.mock.return_value = ["spam", "eggs"]
|
||||
r = obj.fn(1, 2)
|
||||
self.assertEqual(r, ["spam", "eggs"])
|
||||
self.assertEqual(r.result, ["spam", "eggs"])
|
||||
obj.mock.assert_called_once_with(1, 2)
|
||||
obj.mock.reset_mock()
|
||||
|
||||
# a call with different params should call the mock again
|
||||
obj.mock.return_value = ["chips"]
|
||||
r = obj.fn(1, 3)
|
||||
self.assertEqual(r, ["chips"])
|
||||
self.assertEqual(r.result, ["chips"])
|
||||
obj.mock.assert_called_once_with(1, 3)
|
||||
obj.mock.reset_mock()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue