tests/test-sshserver.py
changeset 37785 b4d85bc122bd
parent 37120 a8a902d7176e
child 41285 cf8677cd7286
equal deleted inserted replaced
37784:ee0d5e9d77b2 37785:b4d85bc122bd
     4 import unittest
     4 import unittest
     5 
     5 
     6 import silenttestrunner
     6 import silenttestrunner
     7 
     7 
     8 from mercurial import (
     8 from mercurial import (
     9     wireproto,
       
    10     wireprotoserver,
     9     wireprotoserver,
       
    10     wireprotov1server,
    11 )
    11 )
    12 
    12 
    13 from mercurial.utils import (
    13 from mercurial.utils import (
    14     procutil,
    14     procutil,
    15 )
    15 )
    27     def assertparse(self, cmd, input, expected):
    27     def assertparse(self, cmd, input, expected):
    28         server = mockserver(input)
    28         server = mockserver(input)
    29         proto = wireprotoserver.sshv1protocolhandler(server._ui,
    29         proto = wireprotoserver.sshv1protocolhandler(server._ui,
    30                                                      server._fin,
    30                                                      server._fin,
    31                                                      server._fout)
    31                                                      server._fout)
    32         _func, spec = wireproto.commands[cmd]
    32         _func, spec = wireprotov1server.commands[cmd]
    33         self.assertEqual(proto.getargs(spec), expected)
    33         self.assertEqual(proto.getargs(spec), expected)
    34 
    34 
    35 def mockserver(inbytes):
    35 def mockserver(inbytes):
    36     ui = mockui(inbytes)
    36     ui = mockui(inbytes)
    37     repo = mockrepo(ui)
    37     repo = mockrepo(ui)