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

+6
View File
@@ -22,6 +22,7 @@ from tests.utils import AsyncioMagicMock
@pytest.fixture
@pytest.mark.asyncio
async def node(project):
compute = MagicMock()
@@ -33,6 +34,7 @@ async def node(project):
return await project.add_node(compute, "test", None, node_type="vpcs", properties={"startup_config": "test.cfg"})
@pytest.mark.asyncio
async def test_emit_to_all(controller, project):
"""
Send an event to all if we don't have a project id in the event
@@ -49,6 +51,7 @@ async def test_emit_to_all(controller, project):
assert len(notif._project_listeners[project.id]) == 0
@pytest.mark.asyncio
async def test_emit_to_project(controller, project):
"""
Send an event to a project listeners
@@ -67,6 +70,7 @@ async def test_emit_to_project(controller, project):
assert len(notif._project_listeners[project.id]) == 0
@pytest.mark.asyncio
async def test_dispatch(controller, project):
notif = controller.notification
@@ -78,6 +82,7 @@ async def test_dispatch(controller, project):
assert msg == ('test', {}, {})
@pytest.mark.asyncio
async def test_dispatch_ping(controller, project):
notif = controller.notification
@@ -89,6 +94,7 @@ async def test_dispatch_ping(controller, project):
assert msg == ('ping', {'compute_id': 12}, {})
@pytest.mark.asyncio
async def test_dispatch_node_updated(controller, node, project):
"""
When we receive a node.updated notification from compute