#NEWLINE# def test_protocol_factory( self ) : #NEWLINE# #INDENT# mock_name = 'test_protocol_factory' #NEWLINE# socket = MagicMock ( mock_name = mock_name ) #NEWLINE# protocol = self . factory . getProtocol ( socket ) #NEWLINE# base = 'expected {0}, received {1}' #NEWLINE# msg = base . format ( KMIPProtocol , protocol ) #NEWLINE# self . assertIsInstance ( protocol , KMIPProtocol , msg ) #NEWLINE# self . assertEqual ( protocol . socket . mock_name , mock_name , msg )