#NEWLINE# def test_on_channel_open( self ) : #NEWLINE# #INDENT# ch = BaseChannel ( ) #NEWLINE# transport = Mock ( ) #NEWLINE# ch . on_channel_open ( transport ) #NEWLINE# transport . add_on_close_callback . assert_called_once_with ( ch . on_channel_close ) #NEWLINE# self . assertEquals ( ch . _transport , transport )