tests/test-check-interfaces.py
changeset 37006 8e89c2bec1f7
parent 36370 11ba1a96f946
child 37181 0dfb5672f015
equal deleted inserted replaced
37005:66c0ff381cfc 37006:8e89c2bec1f7
    48     def filtered(self, name):
    48     def filtered(self, name):
    49         pass
    49         pass
    50     def _restrictcapabilities(self, caps):
    50     def _restrictcapabilities(self, caps):
    51         pass
    51         pass
    52 
    52 
       
    53 class dummyopener(object):
       
    54     handlers = []
       
    55 
    53 # Facilitates testing sshpeer without requiring an SSH server.
    56 # Facilitates testing sshpeer without requiring an SSH server.
    54 class badpeer(httppeer.httppeer):
    57 class badpeer(httppeer.httppeer):
    55     def __init__(self):
    58     def __init__(self):
    56         super(badpeer, self).__init__(uimod.ui(), 'http://localhost')
    59         super(badpeer, self).__init__(None, None, None, dummyopener())
    57         self.badattribute = True
    60         self.badattribute = True
    58 
    61 
    59     def badmethod(self):
    62     def badmethod(self):
    60         pass
    63         pass
    61 
    64 
    65 
    68 
    66 def main():
    69 def main():
    67     ui = uimod.ui()
    70     ui = uimod.ui()
    68 
    71 
    69     checkobject(badpeer())
    72     checkobject(badpeer())
    70     checkobject(httppeer.httppeer(ui, 'http://localhost'))
    73     checkobject(httppeer.httppeer(None, None, None, dummyopener()))
    71     checkobject(localrepo.localpeer(dummyrepo()))
    74     checkobject(localrepo.localpeer(dummyrepo()))
    72     checkobject(sshpeer.sshv1peer(ui, 'ssh://localhost/foo', None, dummypipe(),
    75     checkobject(sshpeer.sshv1peer(ui, 'ssh://localhost/foo', None, dummypipe(),
    73                                   dummypipe(), None, None))
    76                                   dummypipe(), None, None))
    74     checkobject(sshpeer.sshv2peer(ui, 'ssh://localhost/foo', None, dummypipe(),
    77     checkobject(sshpeer.sshv2peer(ui, 'ssh://localhost/foo', None, dummypipe(),
    75                                   dummypipe(), None, None))
    78                                   dummypipe(), None, None))