Skip to content
Myr

Fix remaining references to BaseStream in tests (#347)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Florimond Manca · committed by GitHub · parent 315a18b · Browse files · 1 file+5 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−5 removed

  • tests:+5 added−5 removed

1 file+5 added−5 removed

modified:tests/dispatch/utils.py+5 added-5 removed
167 unmodified lines
168 self.data_to_send = data_to_send169 self.received_data = []170 self.stream = MockRawSocketStream(self)171172 async def connect(172 async def open_tcp_stream(173 self,174 hostname: str,175 port: int,176 ssl_context: typing.Optional[ssl.SSLContext],177 timeout: TimeoutConfig,178 ) -> BaseStream:178 ) -> BaseTCPStream:179 self.received_data.append(180 b"--- CONNECT(%s, %d) ---" % (hostname.encode(), port)181 )182 return self.stream183184 async def start_tls(185 self,186 stream: BaseStream,186 stream: BaseTCPStream,187 hostname: str,188 ssl_context: ssl.SSLContext,189 timeout: TimeoutConfig,190 ) -> BaseStream:190 ) -> BaseTCPStream:191 self.received_data.append(b"--- START_TLS(%s) ---" % hostname.encode())192 return self.stream193194 # Defer all other attributes and methods to the underlying backend.195 def __getattr__(self, name: str) -> typing.Any:196 return getattr(self.backend, name)197198199class MockRawSocketStream(BaseStream):199class MockRawSocketStream(BaseTCPStream):200 def __init__(self, backend: MockRawSocketBackend):201 self.backend = backend202203 def get_http_version(self) -> str:
17 unmodified lines