Skip to content

Commit

Permalink
await
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed Jan 31, 2025
1 parent 85747b7 commit e8d102d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/rest/client/test_reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ def prepare(self, reactor: MemoryReactor, clock: Clock, hs: HomeServer) -> None:
self.report_path = f"/_matrix/client/unstable/org.matrix.msc4260/users/{self.target_user_id}/report"

@override_config({"experimental_features": {"msc4260_enabled": True}})
def test_reason_str(self) -> None:
async def test_reason_str(self) -> None:
data = {"reason": "this makes me sad"}
self._assert_status(200, data)
self.assertEqual(
1, self.hs.get_datastores().main.get_user_report_ids(self.target_user_id)
1, await self.hs.get_datastores().main.get_user_report_ids(self.target_user_id)
)

@override_config({"experimental_features": {"msc4260_enabled": True}})
Expand Down Expand Up @@ -262,7 +262,7 @@ def test_cannot_report_nonlcoal_user(self) -> None:
)

@override_config({"experimental_features": {"msc4260_enabled": True}})
def test_can_report_nonexistent_user(self) -> None:
async def test_can_report_nonexistent_user(self) -> None:
"""
Tests that we ignore reports for nonexistent users.
"""
Expand All @@ -276,7 +276,7 @@ def test_can_report_nonexistent_user(self) -> None:
)
self.assertEqual(200, channel.code, msg=channel.result["body"])
self.assertEqual(
0, self.hs.get_datastores().main.get_user_report_ids(target_user_id)
0, await self.hs.get_datastores().main.get_user_report_ids(target_user_id)
)

def _assert_status(self, response_status: int, data: JsonDict) -> None:
Expand Down

0 comments on commit e8d102d

Please sign in to comment.