Skip to content

Commit

Permalink
Make sure mocked endpoint takes at least a few milliseconds to comple…
Browse files Browse the repository at this point in the history
…te (#1196)
  • Loading branch information
leplatrem authored Apr 4, 2023
1 parent f95406f commit 0306274
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_basic_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,14 @@ async def test_check_run_bad_value(cli):


async def test_check_positive(cli, mock_aioresponses):
def slow_down(url, **kwargs):
time.sleep(0.01)

mock_aioresponses.get(
"http://server.local/__heartbeat__", status=200, payload={"ok": True}
"http://server.local/__heartbeat__",
status=200,
payload={"ok": True},
callback=slow_down,
)

response = await cli.get("/checks/testproject/hb")
Expand Down

0 comments on commit 0306274

Please sign in to comment.