summary refs log tree commit diff
path: root/tests/util/caches
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-10-30 11:35:46 +0000
committerErik Johnston <erik@matrix.org>2019-10-30 11:35:46 +0000
commit326b3dace77aeb36e516ea9b04ba1baa171bcb47 (patch)
tree5eb76e0cd616ac49bbaf0eede5705411fd31401c /tests/util/caches
parentFix typo in domain name in account_threepid_delegates config option (#6273) (diff)
downloadsynapse-326b3dace77aeb36e516ea9b04ba1baa171bcb47.tar.xz
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.
Diffstat (limited to 'tests/util/caches')
-rw-r--r--tests/util/caches/test_descriptors.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/util/caches/test_descriptors.py b/tests/util/caches/test_descriptors.py
index f907903511..39e360fe24 100644
--- a/tests/util/caches/test_descriptors.py
+++ b/tests/util/caches/test_descriptors.py
@@ -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()