Mercurial > hg
annotate tests/test-check-interfaces.py @ 37296:78103e4138b1
wireproto: port protocol handler to zope.interface
zope.interface is superior to the abc module. Let's port to it.
As part of this, we add tests for interface conformance for
classes implementing the interface.
Differential Revision: https://phab.mercurial-scm.org/D2983
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 23 Mar 2018 16:24:53 -0700 |
parents | 0dfb5672f015 |
children | 39f7d4ee8bcd |
rev | line source |
---|---|
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 |
33807
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
28 def checkobject(o): |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
29 """Verify a constructed object conforms to interface rules. |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
30 |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
31 An object must have __abstractmethods__ defined. |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
32 |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
33 All "public" attributes of the object (attributes not prefixed with |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
34 an underscore) must be in __abstractmethods__ or appear on a base class |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
35 with __abstractmethods__. |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
36 """ |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
37 name = o.__class__.__name__ |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
38 |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
39 allowed = set() |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
40 for cls in o.__class__.__mro__: |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
41 if not getattr(cls, '__abstractmethods__', set()): |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
42 continue |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
43 |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
44 allowed |= cls.__abstractmethods__ |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
45 allowed |= {a for a in dir(cls) if not a.startswith('_')} |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
46 |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
47 if not allowed: |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
48 print('%s does not have abstract methods' % name) |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
49 return |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
50 |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
51 public = {a for a in dir(o) if not a.startswith('_')} |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
52 |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
53 for attr in sorted(public - allowed): |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
54 print('public attributes not in abstract interface: %s.%s' % ( |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
55 name, attr)) |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
56 |
37181
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
57 def checkzobject(o): |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
58 """Verify an object with a zope interface.""" |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
59 ifaces = zi.providedBy(o) |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
60 if not ifaces: |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
61 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
|
62 return |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
63 |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
64 # 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
|
65 # 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
|
66 for iface in ifaces: |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
67 ziverify.verifyObject(iface, o) |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
68 |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
69 # 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
|
70 # aren't declared as part of interfaces. |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
71 allowed = set() |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
72 for iface in ifaces: |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
73 allowed |= set(iface.names(all=True)) |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
74 |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
75 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
|
76 |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
77 for attr in sorted(public - allowed): |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
78 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
|
79 o.__class__.__name__, attr)) |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
80 |
33807
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
81 # Facilitates testing localpeer. |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
82 class dummyrepo(object): |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
83 def __init__(self): |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
84 self.ui = uimod.ui() |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
85 def filtered(self, name): |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
86 pass |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
87 def _restrictcapabilities(self, caps): |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
88 pass |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
89 |
37006
8e89c2bec1f7
httppeer: refactor how httppeer is created (API)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
36370
diff
changeset
|
90 class dummyopener(object): |
8e89c2bec1f7
httppeer: refactor how httppeer is created (API)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
36370
diff
changeset
|
91 handlers = [] |
8e89c2bec1f7
httppeer: refactor how httppeer is created (API)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
36370
diff
changeset
|
92 |
33807
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
93 # 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
|
94 class badpeer(httppeer.httppeer): |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
95 def __init__(self): |
37006
8e89c2bec1f7
httppeer: refactor how httppeer is created (API)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
36370
diff
changeset
|
96 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
|
97 self.badattribute = True |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
98 |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
99 def badmethod(self): |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
100 pass |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
101 |
36370
11ba1a96f946
sshpeer: defer pipe buffering and stderr sidechannel binding
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35978
diff
changeset
|
102 class dummypipe(object): |
11ba1a96f946
sshpeer: defer pipe buffering and stderr sidechannel binding
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35978
diff
changeset
|
103 def close(self): |
11ba1a96f946
sshpeer: defer pipe buffering and stderr sidechannel binding
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35978
diff
changeset
|
104 pass |
11ba1a96f946
sshpeer: defer pipe buffering and stderr sidechannel binding
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35978
diff
changeset
|
105 |
33807
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
106 def main(): |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
107 ui = uimod.ui() |
37181
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
108 # 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
|
109 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
|
110 |
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
111 checkobject(badpeer()) |
37006
8e89c2bec1f7
httppeer: refactor how httppeer is created (API)
Gregory Szorc <gregory.szorc@gmail.com>
parents:
36370
diff
changeset
|
112 checkobject(httppeer.httppeer(None, None, None, dummyopener())) |
33807
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
113 checkobject(localrepo.localpeer(dummyrepo())) |
36370
11ba1a96f946
sshpeer: defer pipe buffering and stderr sidechannel binding
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35978
diff
changeset
|
114 checkobject(sshpeer.sshv1peer(ui, 'ssh://localhost/foo', None, dummypipe(), |
11ba1a96f946
sshpeer: defer pipe buffering and stderr sidechannel binding
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35978
diff
changeset
|
115 dummypipe(), None, None)) |
11ba1a96f946
sshpeer: defer pipe buffering and stderr sidechannel binding
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35978
diff
changeset
|
116 checkobject(sshpeer.sshv2peer(ui, 'ssh://localhost/foo', None, dummypipe(), |
11ba1a96f946
sshpeer: defer pipe buffering and stderr sidechannel binding
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35978
diff
changeset
|
117 dummypipe(), None, None)) |
34307
afcbc6f64d27
tests: add interface checks for bundle, statichttp, and union peers
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33807
diff
changeset
|
118 checkobject(bundlerepo.bundlepeer(dummyrepo())) |
afcbc6f64d27
tests: add interface checks for bundle, statichttp, and union peers
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33807
diff
changeset
|
119 checkobject(statichttprepo.statichttppeer(dummyrepo())) |
afcbc6f64d27
tests: add interface checks for bundle, statichttp, and union peers
Gregory Szorc <gregory.szorc@gmail.com>
parents:
33807
diff
changeset
|
120 checkobject(unionrepo.unionpeer(dummyrepo())) |
33807
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
121 |
37181
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
122 ziverify.verifyClass(repository.completelocalrepository, |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
123 localrepo.localrepository) |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
124 repo = localrepo.localrepository(ui, rootdir) |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
125 checkzobject(repo) |
0dfb5672f015
repository: define interface for local repositories
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37006
diff
changeset
|
126 |
37296
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
127 ziverify.verifyClass(wireprototypes.baseprotocolhandler, |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
128 wireprotoserver.sshv1protocolhandler) |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
129 ziverify.verifyClass(wireprototypes.baseprotocolhandler, |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
130 wireprotoserver.sshv2protocolhandler) |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
131 ziverify.verifyClass(wireprototypes.baseprotocolhandler, |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
132 wireprotoserver.httpv1protocolhandler) |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
133 ziverify.verifyClass(wireprototypes.baseprotocolhandler, |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
134 wireprotoserver.httpv2protocolhandler) |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
135 |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
136 sshv1 = wireprotoserver.sshv1protocolhandler(None, None, None) |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
137 checkzobject(sshv1) |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
138 sshv2 = wireprotoserver.sshv2protocolhandler(None, None, None) |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
139 checkzobject(sshv2) |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
140 |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
141 httpv1 = wireprotoserver.httpv1protocolhandler(None, None, None) |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
142 checkzobject(httpv1) |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
143 httpv2 = wireprotoserver.httpv2protocolhandler(None, None) |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
144 checkzobject(httpv2) |
78103e4138b1
wireproto: port protocol handler to zope.interface
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37181
diff
changeset
|
145 |
33807
b70029f355a3
tests: verify that peer instances only expose interface members
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
146 main() |