summary refs log tree commit diff
path: root/synapse/events/__init__.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2016-04-07 13:17:56 +0100
committerMark Haines <mark.haines@matrix.org>2016-04-07 13:17:56 +0100
commit60ec9793fb44ad445dd1233594957baeede60e4f (patch)
tree8293a7548f4fbf24550dbfff56f87e43f816d89a /synapse/events/__init__.py
parentMerge pull request #703 from matrix-org/erikj/member (diff)
downloadsynapse-60ec9793fb44ad445dd1233594957baeede60e4f.tar.xz
Add tests for get_latest_event_ids_in_room and get_current_state
Diffstat (limited to 'synapse/events/__init__.py')
-rw-r--r--synapse/events/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py
index 13154b1723..81e2126202 100644
--- a/synapse/events/__init__.py
+++ b/synapse/events/__init__.py
@@ -36,6 +36,10 @@ class _EventInternalMetadata(object):
     def is_invite_from_remote(self):
         return getattr(self, "invite_from_remote", False)
 
+    def __eq__(self, other):
+        "Equality check for unit tests."
+        return self.__dict__ == other.__dict__
+
 
 def _event_dict_property(key):
     def getter(self):
@@ -180,3 +184,8 @@ class FrozenEvent(EventBase):
             self.get("type", None),
             self.get("state_key", None),
         )
+
+    def __eq__(self, other):
+        """Equality check for unit tests. Compares internal_metadata as well
+        as the event fields"""
+        return self.__dict__ == other.__dict__