mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Generate new config for each test. Fixes tests.
This commit is contained in:
1 parent
30ebae207f
commit
1b5a5de4bc
9 files changed
+18
-21
No files matched your search
@@ -445,7 +445,6 @@ async def test_create_img_absolute_non_local(app: FastAPI, client: AsyncClient,
|
||||
|
||||
async def test_create_img_absolute_local(app: FastAPI, client: AsyncClient, config) -> None:
|
||||
|
||||
config.settings.Server.local = True
|
||||
params = {
|
||||
"qemu_img": "/tmp/qemu-img",
|
||||
"path": "/tmp/hda.qcow2",
|
||||
|
||||
@@ -30,7 +30,6 @@ pytestmark = pytest.mark.asyncio
|
||||
async def test_shutdown_local(app: FastAPI, client: AsyncClient, config: Config) -> None:
|
||||
|
||||
os.kill = MagicMock()
|
||||
config.settings.Server.local = True
|
||||
response = await client.post(app.url_path_for("shutdown"))
|
||||
assert response.status_code == status.HTTP_204_NO_CONTENT
|
||||
assert os.kill.called
|
||||
|
||||
@@ -178,7 +178,6 @@ async def test_open_project(app: FastAPI, client: AsyncClient, project: Project)
|
||||
|
||||
async def test_load_project(app: FastAPI, client: AsyncClient, project: Project, config) -> None:
|
||||
|
||||
config.settings.Server.local = True
|
||||
with asyncio_patch("gns3server.controller.Controller.load_project", return_value=project) as mock:
|
||||
response = await client.post(app.url_path_for("load_project"), json={"path": "/tmp/test.gns3"})
|
||||
assert response.status_code == status.HTTP_201_CREATED
|
||||
|
||||
Reference in new issue
Block a user