#NEWLINE# def test_connection_close_channels( self ) : #NEWLINE# #INDENT# connection = Connection ( '127.0.0.1' , 'guest' , 'guest' , timeout = 1 , lazy = True ) #NEWLINE# connection . _channels [ 0 ] = FakeChannel ( ) #NEWLINE# connection . _channels [ 1 ] = FakeChannel ( ) #NEWLINE# connection . _channels [ 2 ] = FakeChannel ( FakeChannel . CLOSED ) #NEWLINE# self . assertTrue ( connection . _channels [ 0 ] . is_open ) #NEWLINE# self . assertTrue ( self . _channels [ 1 ] . is_open ) #NEWLINE# self . assertTrue ( connection . _channels [ 2 ] . is_closed ) #NEWLINE# connection . _close_channels ( ) #NEWLINE# self . assertTrue ( connection . _channels [ 0 ] . is_closed ) #NEWLINE# self . assertTrue ( connection . _channels [ 1 ] . is_closed ) #NEWLINE# self . assertTrue ( connection . _channels [ 2 ] . is_closed )