예제 #1
0
async def test_default_deadline(aiohttp_client):
    timeout = 5

    call = await fixtures.setup_fn_call(aiohttp_client,
                                        funcs.timed_sleepr(timeout))
    _, status, _ = await call

    assert 200 == status
예제 #2
0
    def deadline(self, timeout, income_data):
        r = runner.handle_request(funcs.timed_sleepr(timeout + 1), income_data,
                                  self.format_def)
        r = self.loop.run_until_complete(r)

        self.assertIsNotNone(r)
        self.assertEqual(502, r.status())
        self.assertIn("function timed out", r.body()["error"]["message"])
예제 #3
0
async def test_deadline():
    timeout = 5
    now = dt.datetime.now(dt.timezone.utc).astimezone()
    now += dt.timedelta(0, float(timeout))

    call = await fixtures.setup_fn_call(funcs.timed_sleepr(timeout + 1),
                                        deadline=now.isoformat())
    _, status, _ = await call

    assert 502 == status