Mercurial > hg
diff 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 |
line wrap: on
line diff
--- a/tests/test-check-interfaces.py Wed Mar 28 10:40:41 2018 -0700 +++ b/tests/test-check-interfaces.py Fri Mar 23 16:24:53 2018 -0700 @@ -19,6 +19,8 @@ statichttprepo, ui as uimod, unionrepo, + wireprotoserver, + wireprototypes, ) rootdir = os.path.normpath(os.path.join(os.path.dirname(__file__), '..')) @@ -122,4 +124,23 @@ repo = localrepo.localrepository(ui, rootdir) checkzobject(repo) + ziverify.verifyClass(wireprototypes.baseprotocolhandler, + wireprotoserver.sshv1protocolhandler) + ziverify.verifyClass(wireprototypes.baseprotocolhandler, + wireprotoserver.sshv2protocolhandler) + ziverify.verifyClass(wireprototypes.baseprotocolhandler, + wireprotoserver.httpv1protocolhandler) + ziverify.verifyClass(wireprototypes.baseprotocolhandler, + wireprotoserver.httpv2protocolhandler) + + sshv1 = wireprotoserver.sshv1protocolhandler(None, None, None) + checkzobject(sshv1) + sshv2 = wireprotoserver.sshv2protocolhandler(None, None, None) + checkzobject(sshv2) + + httpv1 = wireprotoserver.httpv1protocolhandler(None, None, None) + checkzobject(httpv1) + httpv2 = wireprotoserver.httpv2protocolhandler(None, None) + checkzobject(httpv2) + main()