tests/test-check-interfaces.py
author Gregory Szorc <gregory.szorc@gmail.com>
Fri, 30 Mar 2018 18:53:17 -0700
changeset 37320 39f7d4ee8bcd
parent 37296 78103e4138b1
child 37441 a3202fa83aff
permissions -rw-r--r--
repository: port peer interfaces to zope.interface zope.interface is superior. Let's switch to it. Unlike abc, which defines interfaces through a base class, zope.interface uses different types for interfaces and for implementations. So, we had to invent some new types to hold the interfaces in order to separate the interface from its default implementation. The names here could probably be better. I've been wanting to overhaul the peer interface for a while. And wire protocol version 2 will force that work. So anticipate a refactoring of these interfaces in later commits. With this commit, we no longer test abc interfaces in test-check-interfaces.py, so code for that has been removed. Differential Revision: https://phab.mercurial-scm.org/D3068 # no-check-commit because of stream_out()
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33807
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     1
# Test that certain objects conform to well-defined interfaces.
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     2
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     3
from __future__ import absolute_import, print_function
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     4
37181
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
     5
import os
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
     6
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
     7
from mercurial.thirdparty.zope import (
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
     8
    interface as zi,
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
     9
)
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    10
from mercurial.thirdparty.zope.interface import (
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    11
    verify as ziverify,
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    12
)
33807
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    13
from mercurial import (
34307
afcbc6f64d27 tests: add interface checks for bundle, statichttp, and union peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33807
diff changeset
    14
    bundlerepo,
33807
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    15
    httppeer,
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    16
    localrepo,
37181
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    17
    repository,
33807
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    18
    sshpeer,
34307
afcbc6f64d27 tests: add interface checks for bundle, statichttp, and union peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33807
diff changeset
    19
    statichttprepo,
33807
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    20
    ui as uimod,
34307
afcbc6f64d27 tests: add interface checks for bundle, statichttp, and union peers
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33807
diff changeset
    21
    unionrepo,
37296
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
    22
    wireprotoserver,
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
    23
    wireprototypes,
33807
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    24
)
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    25
37181
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    26
rootdir = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    27
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    28
def checkzobject(o):
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    29
    """Verify an object with a zope interface."""
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    30
    ifaces = zi.providedBy(o)
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    31
    if not ifaces:
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    32
        print('%r does not provide any zope interfaces' % o)
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    33
        return
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    34
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    35
    # Run zope.interface's built-in verification routine. This verifies that
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    36
    # everything that is supposed to be present is present.
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    37
    for iface in ifaces:
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    38
        ziverify.verifyObject(iface, o)
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    39
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    40
    # Now verify that the object provides no extra public attributes that
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    41
    # aren't declared as part of interfaces.
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    42
    allowed = set()
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    43
    for iface in ifaces:
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    44
        allowed |= set(iface.names(all=True))
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    45
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    46
    public = {a for a in dir(o) if not a.startswith('_')}
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    47
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    48
    for attr in sorted(public - allowed):
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    49
        print('public attribute not declared in interfaces: %s.%s' % (
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    50
            o.__class__.__name__, attr))
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    51
33807
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    52
# Facilitates testing localpeer.
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    53
class dummyrepo(object):
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    54
    def __init__(self):
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    55
        self.ui = uimod.ui()
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    56
    def filtered(self, name):
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    57
        pass
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    58
    def _restrictcapabilities(self, caps):
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    59
        pass
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    60
37006
8e89c2bec1f7 httppeer: refactor how httppeer is created (API)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36370
diff changeset
    61
class dummyopener(object):
8e89c2bec1f7 httppeer: refactor how httppeer is created (API)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36370
diff changeset
    62
    handlers = []
8e89c2bec1f7 httppeer: refactor how httppeer is created (API)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36370
diff changeset
    63
33807
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    64
# Facilitates testing sshpeer without requiring an SSH server.
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    65
class badpeer(httppeer.httppeer):
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    66
    def __init__(self):
37006
8e89c2bec1f7 httppeer: refactor how httppeer is created (API)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36370
diff changeset
    67
        super(badpeer, self).__init__(None, None, None, dummyopener())
33807
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    68
        self.badattribute = True
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    69
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    70
    def badmethod(self):
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    71
        pass
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    72
36370
11ba1a96f946 sshpeer: defer pipe buffering and stderr sidechannel binding
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35978
diff changeset
    73
class dummypipe(object):
11ba1a96f946 sshpeer: defer pipe buffering and stderr sidechannel binding
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35978
diff changeset
    74
    def close(self):
11ba1a96f946 sshpeer: defer pipe buffering and stderr sidechannel binding
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35978
diff changeset
    75
        pass
11ba1a96f946 sshpeer: defer pipe buffering and stderr sidechannel binding
Gregory Szorc <gregory.szorc@gmail.com>
parents: 35978
diff changeset
    76
33807
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    77
def main():
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    78
    ui = uimod.ui()
37181
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    79
    # Needed so we can open a local repo with obsstore without a warning.
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
    80
    ui.setconfig('experimental', 'evolution.createmarkers', True)
33807
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    81
37320
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    82
    checkzobject(badpeer())
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    83
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    84
    ziverify.verifyClass(repository.ipeerbaselegacycommands,
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    85
                         httppeer.httppeer)
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    86
    checkzobject(httppeer.httppeer(None, None, None, dummyopener()))
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    87
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    88
    ziverify.verifyClass(repository.ipeerbase,
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    89
                         localrepo.localpeer)
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    90
    checkzobject(localrepo.localpeer(dummyrepo()))
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    91
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    92
    ziverify.verifyClass(repository.ipeerbaselegacycommands,
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    93
                         sshpeer.sshv1peer)
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    94
    checkzobject(sshpeer.sshv1peer(ui, 'ssh://localhost/foo', None, dummypipe(),
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    95
                                   dummypipe(), None, None))
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    96
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    97
    ziverify.verifyClass(repository.ipeerbaselegacycommands,
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    98
                         sshpeer.sshv2peer)
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
    99
    checkzobject(sshpeer.sshv2peer(ui, 'ssh://localhost/foo', None, dummypipe(),
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
   100
                                   dummypipe(), None, None))
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
   101
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
   102
    ziverify.verifyClass(repository.ipeerbase, bundlerepo.bundlepeer)
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
   103
    checkzobject(bundlerepo.bundlepeer(dummyrepo()))
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
   104
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
   105
    ziverify.verifyClass(repository.ipeerbase, statichttprepo.statichttppeer)
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
   106
    checkzobject(statichttprepo.statichttppeer(dummyrepo()))
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
   107
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
   108
    ziverify.verifyClass(repository.ipeerbase, unionrepo.unionpeer)
39f7d4ee8bcd repository: port peer interfaces to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37296
diff changeset
   109
    checkzobject(unionrepo.unionpeer(dummyrepo()))
33807
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   110
37181
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
   111
    ziverify.verifyClass(repository.completelocalrepository,
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
   112
                         localrepo.localrepository)
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
   113
    repo = localrepo.localrepository(ui, rootdir)
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
   114
    checkzobject(repo)
0dfb5672f015 repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37006
diff changeset
   115
37296
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   116
    ziverify.verifyClass(wireprototypes.baseprotocolhandler,
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   117
                         wireprotoserver.sshv1protocolhandler)
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   118
    ziverify.verifyClass(wireprototypes.baseprotocolhandler,
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   119
                         wireprotoserver.sshv2protocolhandler)
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   120
    ziverify.verifyClass(wireprototypes.baseprotocolhandler,
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   121
                         wireprotoserver.httpv1protocolhandler)
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   122
    ziverify.verifyClass(wireprototypes.baseprotocolhandler,
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   123
                         wireprotoserver.httpv2protocolhandler)
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   124
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   125
    sshv1 = wireprotoserver.sshv1protocolhandler(None, None, None)
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   126
    checkzobject(sshv1)
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   127
    sshv2 = wireprotoserver.sshv2protocolhandler(None, None, None)
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   128
    checkzobject(sshv2)
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   129
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   130
    httpv1 = wireprotoserver.httpv1protocolhandler(None, None, None)
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   131
    checkzobject(httpv1)
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   132
    httpv2 = wireprotoserver.httpv2protocolhandler(None, None)
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   133
    checkzobject(httpv2)
78103e4138b1 wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents: 37181
diff changeset
   134
33807
b70029f355a3 tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   135
main()