#NEWLINE# def test_filtered_channel( self ) : #NEWLINE# #INDENT# "Verify that message filtering works\n\n        The sender sends a message that is expected to be filtered by FilteredChannel.\n        The test verifies that the receiver doesn't get the message\n        " #NEWLINE# channelFilter = FilteredChannelFactory . FilteredChannel ( callbackScheduler , self . filterMinId ) #NEWLINE# try : #NEWLINE# #INDENT# ( sender , receiver ) = channelFilter . getChannelPair ( ) #NEWLINE# filteredMessage = SharedState . MessageOut . MinimumIdResponse ( 0 ) #NEWLINE# sender . write ( filteredMessage ) #NEWLINE# toGet = [ None ] #NEWLINE# def tryGet( ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# toGet [ 0 ] = receiver . get ( ) #NEWLINE# #UNINDENT# except UserWarning : #NEWLINE# #INDENT# if channelFilter . stopFlag . is_set ( ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# t = ManagedThread . ManagedThread ( target = tryGet ) #NEWLINE# t . start ( ) #NEWLINE# t . join ( 1 ) #NEWLINE# self . assertIsNone ( toGet [ 0 ] ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# channelFilter . teardown ( )