Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Add some missing types.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Nov 10, 2022
1 parent d7f5939 commit 547a626
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/replication/test_multi_media_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
import os
from typing import Optional, Tuple

from twisted.internet.interfaces import IOpenSSLServerConnectionCreator
from twisted.internet.protocol import Factory
from twisted.protocols.tls import TLSMemoryBIOFactory
from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol
from twisted.web.http import HTTPChannel
from twisted.web.server import Request

Expand Down Expand Up @@ -102,7 +103,7 @@ def _get_media_req(
)

# fish the test server back out of the server-side TLS protocol.
http_server = server_tls_protocol.wrappedProtocol
http_server: HTTPChannel = server_tls_protocol.wrappedProtocol # type: ignore[assignment]

# give the reactor a pump to get the TLS juices flowing.
self.reactor.pump((0.1,))
Expand Down Expand Up @@ -238,14 +239,15 @@ def get_connection_factory():
return test_server_connection_factory


def _build_test_server(connection_creator):
def _build_test_server(
connection_creator: IOpenSSLServerConnectionCreator,
) -> TLSMemoryBIOProtocol:
"""Construct a test server
This builds an HTTP channel, wrapped with a TLSMemoryBIOProtocol
Args:
connection_creator (IOpenSSLServerConnectionCreator): thing to build
SSL connections
connection_creator: thing to build SSL connections
Returns:
TLSMemoryBIOProtocol
Expand Down

0 comments on commit 547a626

Please sign in to comment.