#NEWLINE# def test_rpc_server( self ) : #NEWLINE# #INDENT# node = Mock ( spec = NodeB ) #NEWLINE# svc = SimpleService ( ) #NEWLINE# rpcs = RPCServer ( node = self , from_name = 'testrpc' , service = svc ) #NEWLINE# node . interceptors = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# class FakeMsg ( object ) : #NEWLINE# #INDENT# def __init__( self ) : #NEWLINE# #INDENT# self . named = [ 'ein' , 'zwei' ] #NEWLINE# #UNINDENT# #UNINDENT# cvalue = FakeMsg ( ) #NEWLINE# listen_channel_mock = self . _setup_mock_channel ( ch_type = ServerChannel ) #NEWLINE# rpcs . node . channel . return_value = listen_channel_mock #NEWLINE# listen_channel_mock . accept . return_value = self . _setup_mock_channel ( ch_type = ServerChannel . BidirAcceptChannel , value = cvalue , op = 'simple' ) #NEWLINE# rpcs . listen ( ) #NEWLINE# ret = svc . _ar . get ( ) #NEWLINE# self . assertIsInstance ( ret , list ) #NEWLINE# self . assertEquals ( ret , [ 'ein' , 'zwei' ] )