summary refs log tree commit diff
path: root/tests/test_visibility.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-10-31 16:17:53 +0100
committerGitHub <noreply@github.com>2019-10-31 16:17:53 +0100
commitdfe0cd71b61c043592cc27b64725918aa5c64724 (patch)
treeec416471ef0ef54e0f959a9618a07e6ba9ccb64c /tests/test_visibility.py
parentExpose some homeserver functionality to spam checkers (#6259) (diff)
parentApply suggestions from code review (diff)
downloadsynapse-dfe0cd71b61c043592cc27b64725918aa5c64724.tar.xz
Merge pull request #6294 from matrix-org/erikj/add_state_storage
Add StateGroupStorage interface
Diffstat (limited to 'tests/test_visibility.py')
-rw-r--r--tests/test_visibility.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/test_visibility.py b/tests/test_visibility.py
index 6ae1ea9b04..f7381b2885 100644
--- a/tests/test_visibility.py
+++ b/tests/test_visibility.py
@@ -14,6 +14,8 @@
 # limitations under the License.
 import logging
 
+from mock import Mock
+
 from twisted.internet import defer
 from twisted.internet.defer import succeed
 
@@ -63,7 +65,7 @@ class FilterEventsForServerTestCase(tests.unittest.TestCase):
             events_to_filter.append(evt)
 
         filtered = yield filter_events_for_server(
-            self.store, "test_server", events_to_filter
+            self.storage, "test_server", events_to_filter
         )
 
         # the result should be 5 redacted events, and 5 unredacted events.
@@ -101,7 +103,7 @@ class FilterEventsForServerTestCase(tests.unittest.TestCase):
 
         # ... and the filtering happens.
         filtered = yield filter_events_for_server(
-            self.store, "test_server", events_to_filter
+            self.storage, "test_server", events_to_filter
         )
 
         for i in range(0, len(events_to_filter)):
@@ -258,6 +260,11 @@ class FilterEventsForServerTestCase(tests.unittest.TestCase):
 
         logger.info("Starting filtering")
         start = time.time()
+
+        storage = Mock()
+        storage.main = test_store
+        storage.state = test_store
+
         filtered = yield filter_events_for_server(
             test_store, "test_server", events_to_filter
         )