tests/test-commandserver.t
changeset 23322 000cfc8b3913
parent 23095 ac827031fe05
child 23324 69f86b937035
equal deleted inserted replaced
23321:d716b1cec5cf 23322:000cfc8b3913
   522   password: 1234
   522   password: 1234
   523   *** runcommand debugprompt --config ui.interactive=True
   523   *** runcommand debugprompt --config ui.interactive=True
   524   prompt: 5678
   524   prompt: 5678
   525 
   525 
   526 
   526 
       
   527 run commandserver in commandserver, which is silly but should work:
       
   528 
       
   529   >>> import cStringIO
       
   530   >>> from hgclient import readchannel, runcommand, check
       
   531   >>> @check
       
   532   ... def nested(server):
       
   533   ...     print '%c, %r' % readchannel(server)
       
   534   ...     class nestedserver(object):
       
   535   ...         stdin = cStringIO.StringIO('getencoding\n')
       
   536   ...         stdout = cStringIO.StringIO()
       
   537   ...     runcommand(server, ['serve', '--cmdserver', 'pipe'],
       
   538   ...                output=nestedserver.stdout, input=nestedserver.stdin)
       
   539   ...     nestedserver.stdout.seek(0)
       
   540   ...     print '%c, %r' % readchannel(nestedserver)  # hello
       
   541   ...     print '%c, %r' % readchannel(nestedserver)  # getencoding
       
   542   o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob)
       
   543   *** runcommand serve --cmdserver pipe
       
   544   o, 'capabilities: getencoding runcommand\nencoding: *\npid: *' (glob)
       
   545   r, '*' (glob)
       
   546 
       
   547 
   527 start without repository:
   548 start without repository:
   528 
   549 
   529   $ cd ..
   550   $ cd ..
   530 
   551 
   531   >>> from hgclient import readchannel, runcommand, check
   552   >>> from hgclient import readchannel, runcommand, check