Migration to FastAPI

This commit is contained in:
grossmj committed 2020-10-02 16:07:50 +09:30
1 parent c12b675691
commit eb3cb8a41f
224 files changed
+11254 -13517

No files matched your search

+5 -1
View File
@@ -25,6 +25,7 @@ from gns3server.utils.asyncio import wait_run_in_executor, subprocess_check_outp
from tests.utils import AsyncioMagicMock
@pytest.mark.asyncio
async def test_wait_run_in_executor():
def change_var(param):
@@ -34,6 +35,7 @@ async def test_wait_run_in_executor():
assert result == "test"
@pytest.mark.asyncio
async def test_exception_wait_run_in_executor():
def raise_exception():
@@ -44,13 +46,15 @@ async def test_exception_wait_run_in_executor():
@pytest.mark.skipif(sys.platform.startswith("win"), reason="Not supported on Windows")
async def test_subprocess_check_output(loop, tmpdir):
@pytest.mark.asyncio
async def test_subprocess_check_output(tmpdir):
path = str(tmpdir / "test")
result = await subprocess_check_output("echo", "-n", path)
assert result == path
@pytest.mark.asyncio
async def test_lock_decorator():
"""
The test check if the the second call to method_to_lock wait for the
+3
View File
@@ -24,6 +24,7 @@ from gns3server.utils.file_watcher import FileWatcher
@pytest.mark.parametrize("strategy", ['mtime', 'hash'])
@pytest.mark.asyncio
async def test_file_watcher(tmpdir, strategy):
file = tmpdir / "test"
@@ -38,6 +39,7 @@ async def test_file_watcher(tmpdir, strategy):
@pytest.mark.parametrize("strategy", ['mtime', 'hash'])
@pytest.mark.asyncio
async def test_file_watcher_not_existing(tmpdir, strategy):
file = tmpdir / "test"
@@ -51,6 +53,7 @@ async def test_file_watcher_not_existing(tmpdir, strategy):
@pytest.mark.parametrize("strategy", ['mtime', 'hash'])
@pytest.mark.asyncio
async def test_file_watcher_list(tmpdir, strategy):
file = tmpdir / "test"