From 476a89707ada05c0767324063d9c5814547d3ae1 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Wed, 10 Jun 2020 17:55:03 +0100 Subject: Fix tests --- tests/replication/slave/storage/test_events.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests/replication/slave/storage/test_events.py') diff --git a/tests/replication/slave/storage/test_events.py b/tests/replication/slave/storage/test_events.py index 1a88c7fb80..bc667454c1 100644 --- a/tests/replication/slave/storage/test_events.py +++ b/tests/replication/slave/storage/test_events.py @@ -160,7 +160,7 @@ class SlavedEventStoreTestCase(BaseSlavedStoreTestCase): self.check( "get_unread_event_push_actions_by_room_for_user", [ROOM_ID, USER_ID_2, event1.event_id], - {"highlight_count": 0, "notify_count": 0}, + {"highlight_count": 0, "notify_count": 0, "unread_count": 0}, ) self.persist( @@ -173,7 +173,7 @@ class SlavedEventStoreTestCase(BaseSlavedStoreTestCase): self.check( "get_unread_event_push_actions_by_room_for_user", [ROOM_ID, USER_ID_2, event1.event_id], - {"highlight_count": 0, "notify_count": 1}, + {"highlight_count": 0, "notify_count": 1, "unread_count": 1}, ) self.persist( @@ -188,7 +188,7 @@ class SlavedEventStoreTestCase(BaseSlavedStoreTestCase): self.check( "get_unread_event_push_actions_by_room_for_user", [ROOM_ID, USER_ID_2, event1.event_id], - {"highlight_count": 1, "notify_count": 2}, + {"highlight_count": 1, "notify_count": 2, "unread_count": 2}, ) def test_get_rooms_for_user_with_stream_ordering(self): -- cgit 1.5.1 From 6b1fa3293d5e834b6b66c4b9d83a5f938cbcabde Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Fri, 12 Jun 2020 11:28:26 +0100 Subject: Test that a mark_unread action updates the right counter when using a slave store --- tests/replication/slave/storage/test_events.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/replication/slave/storage/test_events.py') diff --git a/tests/replication/slave/storage/test_events.py b/tests/replication/slave/storage/test_events.py index bc667454c1..9837d44995 100644 --- a/tests/replication/slave/storage/test_events.py +++ b/tests/replication/slave/storage/test_events.py @@ -191,6 +191,21 @@ class SlavedEventStoreTestCase(BaseSlavedStoreTestCase): {"highlight_count": 1, "notify_count": 2, "unread_count": 2}, ) + self.persist( + type="m.room.message", + msgtype="m.text", + body="world", + push_actions=[ + (USER_ID_2, ["org.matrix.msc2625.mark_unread"]) + ], + ) + self.replicate() + self.check( + "get_unread_event_push_actions_by_room_for_user", + [ROOM_ID, USER_ID_2, event1.event_id], + {"highlight_count": 1, "notify_count": 2, "unread_count": 3}, + ) + def test_get_rooms_for_user_with_stream_ordering(self): """Check that the cache on get_rooms_for_user_with_stream_ordering is invalidated by rows in the events stream -- cgit 1.5.1 From 7e80c84902f2d34aff1bb8b4c5833cb33d3dc653 Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Fri, 12 Jun 2020 11:31:11 +0100 Subject: Lint --- tests/replication/slave/storage/test_events.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tests/replication/slave/storage/test_events.py') diff --git a/tests/replication/slave/storage/test_events.py b/tests/replication/slave/storage/test_events.py index 9837d44995..cd8680e812 100644 --- a/tests/replication/slave/storage/test_events.py +++ b/tests/replication/slave/storage/test_events.py @@ -195,9 +195,7 @@ class SlavedEventStoreTestCase(BaseSlavedStoreTestCase): type="m.room.message", msgtype="m.text", body="world", - push_actions=[ - (USER_ID_2, ["org.matrix.msc2625.mark_unread"]) - ], + push_actions=[(USER_ID_2, ["org.matrix.msc2625.mark_unread"])], ) self.replicate() self.check( -- cgit 1.5.1