Add unit tests

This commit is contained in:
Brendan Abolivier 2019-10-30 16:15:04 +00:00
parent 233b14ebe1
commit e7943f660a
No known key found for this signature in database
GPG key ID: 1E015C145F1916CD
2 changed files with 52 additions and 1 deletions

View file

@ -307,7 +307,7 @@ class Filter(object):
content = event.get("content", {})
# check if there is a string url field in the content for filtering purposes
contains_url = isinstance(content.get("url"), text_type)
labels = content.get(LabelsField)
labels = content.get(LabelsField, [])
return self.check_fields(room_id, sender, ev_type, labels, contains_url)