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

Commit

Permalink
Add a few missing types.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Nov 10, 2022
1 parent a36e5a6 commit 58706e3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions tests/http/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
import os.path
import subprocess
from typing import List

from zope.interface import implementer

Expand Down Expand Up @@ -70,14 +71,14 @@ def get_test_key_file():
"""


def create_test_cert_file(sanlist):
def create_test_cert_file(sanlist: List[bytes]) -> str:
"""build an x509 certificate file
Args:
sanlist: list[bytes]: a list of subjectAltName values for the cert
sanlist: a list of subjectAltName values for the cert
Returns:
str: the path to the file
The path to the file
"""
global cert_file_count
csr_filename = "server.csr"
Expand Down
7 changes: 5 additions & 2 deletions tests/replication/slave/storage/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def test_invites(self):
self.persist(type="m.room.create", key="", creator=USER_ID)
self.check("get_invited_rooms_for_local_user", [USER_ID_2], [])
event = self.persist(type="m.room.member", key=USER_ID_2, membership="invite")
assert event.internal_metadata.stream_ordering is not None

self.replicate()

Expand Down Expand Up @@ -230,6 +231,7 @@ def test_get_rooms_for_user_with_stream_ordering(self):
j2 = self.persist(
type="m.room.member", sender=USER_ID_2, key=USER_ID_2, membership="join"
)
assert j2.internal_metadata.stream_ordering is not None
self.replicate()

expected_pos = PersistedEventPosition(
Expand Down Expand Up @@ -280,6 +282,7 @@ def test_get_rooms_for_user_with_stream_ordering_with_multi_event_persist(self):
j2, j2ctx = self.build_event(
type="m.room.member", sender=USER_ID_2, key=USER_ID_2, membership="join"
)
assert j2.internal_metadata.stream_ordering is not None
msg, msgctx = self.build_event()
self.get_success(
self._storage_controllers.persistence.persist_events(
Expand Down Expand Up @@ -336,10 +339,10 @@ def test_get_rooms_for_user_with_stream_ordering_with_multi_event_persist(self):

event_id = 0

def persist(self, backfill=False, **kwargs):
def persist(self, backfill=False, **kwargs) -> FrozenEvent:
"""
Returns:
synapse.events.FrozenEvent: The event that was persisted.
The event that was persisted.
"""
event, context = self.build_event(**kwargs)

Expand Down

0 comments on commit 58706e3

Please sign in to comment.