diff options
author | David Robertson <davidr@element.io> | 2023-03-23 14:55:32 +0000 |
---|---|---|
committer | David Robertson <davidr@element.io> | 2023-03-23 14:55:32 +0000 |
commit | ecc10846546f89671dfde12b3b46d0b6a840dc04 (patch) | |
tree | 1899cfa410f2a379caad16cc70a2dfae63f44dcf /tests | |
parent | WIP 4 (diff) | |
download | synapse-ecc10846546f89671dfde12b3b46d0b6a840dc04.tar.xz |
WIP 5
Diffstat (limited to 'tests')
-rw-r--r-- | tests/http/federation/dmr_reproduce_mypy_zope_pain.py | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/tests/http/federation/dmr_reproduce_mypy_zope_pain.py b/tests/http/federation/dmr_reproduce_mypy_zope_pain.py index 9698f5e077..d4170019ef 100644 --- a/tests/http/federation/dmr_reproduce_mypy_zope_pain.py +++ b/tests/http/federation/dmr_reproduce_mypy_zope_pain.py @@ -1,11 +1,25 @@ +from typing import Optional + from twisted.internet.endpoints import _WrappingProtocol -from twisted.internet.interfaces import ( - IProtocolFactory, -) +from twisted.internet.interfaces import IProtocol +from zope.interface import Interface, implementer + + +class IAddress(Interface): + pass + + +@implementer(IAddress) +class DummyAddress: + pass + -from tests.http import ( - dummy_address, -) +dummy_address = DummyAddress() + + +class IProtocolFactory(Interface): + def buildProtocol(addr: IAddress) -> Optional[IProtocol]: + pass def _make_connection( client_factory: IProtocolFactory, @@ -17,6 +31,3 @@ def _make_connection( client_protocol = client_factory.buildProtocol(dummy_address) assert isinstance(client_protocol, _WrappingProtocol) print("Hello") - - - |