mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Finish to clean up local setting usage. Ref #1460
This commit is contained in:
1 parent
2cddb2c05a
commit
888c773dc0
7 files changed
+8
-22
No files matched your search
@@ -30,6 +30,7 @@ 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
|
||||
@@ -37,7 +38,6 @@ async def test_shutdown_local(app: FastAPI, client: AsyncClient, config: Config)
|
||||
|
||||
async def test_shutdown_non_local(app: FastAPI, client: AsyncClient, config: Config) -> None:
|
||||
|
||||
config.settings.Server.local = False
|
||||
response = await client.post(app.url_path_for("shutdown"))
|
||||
assert response.status_code == status.HTTP_403_FORBIDDEN
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ async def test_version_output(app: FastAPI, client: AsyncClient) -> None:
|
||||
|
||||
response = await client.get(app.url_path_for("get_version"))
|
||||
assert response.status_code == status.HTTP_200_OK
|
||||
assert response.json() == {'controller_host': '127.0.0.1', 'local': True, 'version': __version__}
|
||||
assert response.json() == {'controller_host': '127.0.0.1', 'local': False, 'version': __version__}
|
||||
|
||||
|
||||
async def test_version_input(app: FastAPI, client: AsyncClient) -> None:
|
||||
|
||||
Reference in new issue
Block a user