summary refs log tree commit diff
path: root/tests/util/test_stream_change_cache.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-07-17 10:59:02 +0100
committerErik Johnston <erik@matrix.org>2018-07-17 10:59:02 +0100
commit850238b4ef1573a4162048d5ae285bb3fdccf5bb (patch)
tree555e70df6a030714f1b59a13892e5d0b3b3f09ae /tests/util/test_stream_change_cache.py
parentNewsfile (diff)
downloadsynapse-850238b4ef1573a4162048d5ae285bb3fdccf5bb.tar.xz
Add unit test
Diffstat (limited to 'tests/util/test_stream_change_cache.py')
-rw-r--r--tests/util/test_stream_change_cache.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/util/test_stream_change_cache.py b/tests/util/test_stream_change_cache.py
index fc45baaaa0..65b0f2e6fb 100644
--- a/tests/util/test_stream_change_cache.py
+++ b/tests/util/test_stream_change_cache.py
@@ -178,6 +178,22 @@ class StreamChangeCacheTests(unittest.TestCase):
             ),
         )
 
+        # Query a subset of the entries mid-way through the stream. We should
+        # only get back the subset.
+        self.assertEqual(
+            cache.get_entities_changed(
+                [
+                    "bar@baz.net",
+                ],
+                stream_pos=2,
+            ),
+            set(
+                [
+                    "bar@baz.net",
+                ]
+            ),
+        )
+
     def test_max_pos(self):
         """
         StreamChangeCache.get_max_pos_of_last_change will return the most