Add unit test

This commit is contained in:
Erik Johnston 2018-07-17 10:59:02 +01:00
parent 9952d18e4d
commit 850238b4ef
1 changed files with 16 additions and 0 deletions

View File

@ -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