コード例 #1
0
ファイル: test_aiohttp.py プロジェクト: damoxc/spritzle
def test_aiohttp_run():
    def handler(*args, **kwargs):
        pass

    with patch('asyncio.get_event_loop'):
        a = AiohttpServer()
        a.run(handler)
        asyncio.get_event_loop.assert_called_once()
コード例 #2
0
ファイル: test_aiohttp.py プロジェクト: damoxc/spritzle
def test_aiohttp_run_bottle_child():
    def handler(*args, **kwargs):
        pass

    os.environ['BOTTLE_CHILD'] = ''
    with patch('asyncio.get_event_loop'):
        with patch('signal.signal'):
            a = AiohttpServer()
            a.run(handler)
            signal.signal.assert_called_once()