diff --git a/dev-requirements.txt b/dev-requirements.txt index 20104d902..081fea50d 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,7 +1,7 @@ pytest==8.4.2 # version 8.4.2 is the last one supporting Python 3.9 flake8==7.3.0 pytest-timeout==2.4.0 -pytest-asyncio==0.25.2 +pytest-asyncio==1.0.0 # upgrading leads to stuck tests requests==2.32.5 httpx==0.28.1 -httpx_ws==0.7.1 +httpx_ws==0.7.1 # upgrading leads to failures in tests \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index d87796e10..63ef755bf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ -uvicorn==0.34.2 # uvicorn 0.33 is the last version supporting Python 3.8 -pydantic==2.11.7 -fastapi==0.116.1 -python-multipart==0.0.20 -websockets==15.0.1 +uvicorn==0.39.0 # version 0.39.0 is the last version supporting Python 3.9 +pydantic==2.12.5 +fastapi==0.128.0 +python-multipart==0.0.20 # version 0.0.20 is the last to support Python 3.9 +websockets==15.0.1 # version 15.0.1 is the last to support Python 3.9 aiohttp>=3.13.3,<3.14 aiofiles>=25.1.0,<26.0 Jinja2>=3.1.6,<3.2 @@ -12,13 +12,13 @@ async-timeout>=5.0.1,<5.1; python_version < '3.11' # this library has effective distro>=1.9.0 py-cpuinfo>=9.0.0,<10.0 greenlet==3.2.0 # necessary to run sqlalchemy on Python 3.13 -sqlalchemy==2.0.43 +sqlalchemy==2.0.46 aiosqlite==0.21.0 alembic==1.15.2 -bcrypt==4.3.0 -joserfc==1.0.4 -email-validator==2.2.0 +bcrypt==5.0.0 +joserfc==1.6.1 +email-validator==2.3.0 watchdog==6.0.0 -zstandard==0.23.0 +zstandard==0.25.0 platformdirs>=2.4.0,<3 # platformdirs >=3 conflicts when building Debian packages truststore>=0.10.4; python_version >= '3.10' diff --git a/tests/api/routes/controller/test_projects.py b/tests/api/routes/controller/test_projects.py index cd3439c04..9dc23ab37 100644 --- a/tests/api/routes/controller/test_projects.py +++ b/tests/api/routes/controller/test_projects.py @@ -303,7 +303,7 @@ class TestControllerProjectRoutes: params={"include_images": "yes"}) assert response.status_code == status.HTTP_200_OK assert response.headers['CONTENT-TYPE'] == 'application/gns3project' - assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{}.gns3project"'.format(project.name) + assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{name}.gns3project"; filename*=UTF-8\'\'{name}.gns3project'.format(name=project.name) with open(str(tmpdir / 'project.zip'), 'wb+') as f: f.write(response.content) @@ -346,8 +346,7 @@ class TestControllerProjectRoutes: params={"include_images": "0"}) assert response.status_code == status.HTTP_200_OK assert response.headers['CONTENT-TYPE'] == 'application/gns3project' - assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{}.gns3project"'.format(project.name) - + assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{name}.gns3project"; filename*=UTF-8\'\'{name}.gns3project'.format(name=project.name) with open(str(tmpdir / 'project.zip'), 'wb+') as f: f.write(response.content) @@ -412,8 +411,7 @@ class TestControllerProjectRoutes: if response.status_code == status.HTTP_200_OK: assert response.headers['CONTENT-TYPE'] == 'application/gns3project' - assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{}.gns3project"'.format(project.name) - + assert response.headers['CONTENT-DISPOSITION'] == 'attachment; filename="{name}.gns3project"; filename*=UTF-8\'\'{name}.gns3project'.format(name=project.name) with open(str(tmpdir / 'project.zip'), 'wb+') as f: f.write(response.content) diff --git a/tests/api/routes/controller/test_users.py b/tests/api/routes/controller/test_users.py index 87ea74708..e608e1e68 100644 --- a/tests/api/routes/controller/test_users.py +++ b/tests/api/routes/controller/test_users.py @@ -183,7 +183,7 @@ class TestAuthTokens: jwt_secret = config.settings.Controller.jwt_secret_key token = auth_service.create_access_token(test_user.username) with pytest.raises(ValueError): - jwt.decode(token, jwt_secret, algorithms=["ES256"]) + jwt.decode(token, jwt_secret, algorithms=["HS256"]) async def test_can_retrieve_username_from_token( self, diff --git a/tests/compute/docker/test_docker.py b/tests/compute/docker/test_docker.py index d2007d974..917255f78 100644 --- a/tests/compute/docker/test_docker.py +++ b/tests/compute/docker/test_docker.py @@ -216,6 +216,7 @@ async def test_docker_check_connection_docker_preferred_version_against_older(vm assert vm._api_version == DOCKER_MINIMUM_API_VERSION +@pytest.mark.asyncio async def test_docker_check_connection_docker_unsupported_version(vm): response = { diff --git a/tests/compute/docker/test_docker_vm.py b/tests/compute/docker/test_docker_vm.py index 66a4e4947..33eea1cbb 100644 --- a/tests/compute/docker/test_docker_vm.py +++ b/tests/compute/docker/test_docker_vm.py @@ -1791,7 +1791,7 @@ async def test_cpus(compute_project, manager): with asyncio_patch("gns3server.compute.docker.Docker.query", return_value=response) as mock: vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest", cpus=0.5) await vm.create() - mock.assert_called_with("POST", "containers/create", data={ + mock.assert_called_with("POST", "containers/create?name={}".format(vm.docker_name), data={ "Tty": True, "OpenStdin": True, "StdinOnce": False, @@ -1842,7 +1842,7 @@ async def test_memory(compute_project, manager): with asyncio_patch("gns3server.compute.docker.Docker.query", return_value=response) as mock: vm = DockerVM("test", str(uuid.uuid4()), compute_project, manager, "ubuntu:latest", memory=32) await vm.create() - mock.assert_called_with("POST", "containers/create", data={ + mock.assert_called_with("POST", "containers/create?name={}".format(vm.docker_name), data={ "Tty": True, "OpenStdin": True, "StdinOnce": False,