#NEWLINE# @ defer . inlineCallbacks #NEWLINE# def test_filter_presence_match( self ) : #NEWLINE# #INDENT# user_filter_json = { #NEWLINE# #INDENT# 'presence' : { #NEWLINE# #INDENT# 'types' : [ 'm.*' ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# filter_id = ( yield self . datastore . add_user_filter ( user_localpart = user_localpart , user_filter = user_filter_json ) ) #NEWLINE# event = MockEvent ( sender = '@foo:bar' , type = 'm.profile' ) #NEWLINE# events = [ event ] #NEWLINE# user_filter = ( yield self . filtering . get_user_filter ( user_localpart = user_localpart , filter_id = filter_id ) ) #NEWLINE# results = user_filter . filter_presence ( events = events ) #NEWLINE# self . assertEquals ( events , results )