Merge branch 'master' into 2.2

This commit is contained in:
grossmj
2026-04-12 20:35:12 +08:00
5 changed files with 8 additions and 10 deletions

View File

@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Build and run Docker image
run: |
docker build -t gns3-gui-test .

View File

@@ -3,7 +3,7 @@ FROM ubuntu:latest
MAINTAINER GNS3 Team
RUN apt-get update
RUN apt-get install -y --force-yes python3 python3-pyqt5 python3-pip python3-pyqt5.qtsvg python3-pyqt5.qtwebsockets python3-dev xvfb
RUN apt-get install -y --force-yes python3 python3-pyqt6 python3-pip python3-pyqt6.qtsvg python3-pyqt6.qtwebsockets python3-dev xvfb
RUN apt-get clean
ADD dev-requirements.txt /dev-requirements.txt

View File

@@ -59,7 +59,7 @@ def test_deleteCompute(controller):
cm.deleteCompute("test")
assert "test" not in cm._computes
assert callback_delete.called
controller._http_client.createHTTPQuery.assert_called_with("DELETE", "/computes/test", None)
controller._http_client.createHTTPQuery.assert_called_with("DELETE", "/computes/test")
def test_listComputesCallback():

View File

@@ -66,7 +66,6 @@ def test_get_connected(http_client, http_request, network_manager, response):
http_client.createHTTPQuery("GET", "/test", callback)
http_request.assert_called_with(QtCore.QUrl("http://127.0.0.1:3080/v2/test"))
http_request.setRawHeader.assert_any_call(b"Content-Type", b"application/json")
http_request.setRawHeader.assert_any_call(b"User-Agent", "GNS3 QT Client v{version}".format(version=__version__).encode())
assert network_manager.sendCustomRequest.called
args, kwargs = network_manager.sendCustomRequest.call_args
@@ -80,7 +79,7 @@ def test_get_connected(http_client, http_request, network_manager, response):
def test_paramsToQueryString(http_client):
assert http_client._paramsToQueryString({}) == ""
assert http_client._paramsToQueryString(None) == ""
res = http_client._paramsToQueryString({"a": 1, "b": 2})
assert res == "?a=1&b=2" or res == "?b=2&a=1"
res = http_client._paramsToQueryString({"a": 1, "b": 2, "c": None})
@@ -96,7 +95,6 @@ def test_get_connected_auth(http_client, http_request, network_manager, response
http_client.createHTTPQuery("GET", "/test", callback)
http_request.assert_called_with(QtCore.QUrl("http://gns3@127.0.0.1:3080/v2/test"))
http_request.setRawHeader.assert_any_call(b"Content-Type", b"application/json")
http_request.setRawHeader.assert_any_call(b"Authorization", b"Basic Z25zMzozc25n")
http_request.setRawHeader.assert_any_call(b"User-Agent", "GNS3 QT Client v{version}".format(version=__version__).encode())
assert network_manager.sendCustomRequest.called
@@ -115,7 +113,7 @@ def test_post_not_connected(http_client, http_request, network_manager, response
http_client._connected = False
callback = unittest.mock.MagicMock()
http_client.createHTTPQuery("POST", "/test", callback, context={"toto": 42})
http_client.createHTTPQuery("POST", "/test", callback, context={"query_id": 42})
args, kwargs = network_manager.sendCustomRequest.call_args
assert args[0] == http_request
@@ -138,7 +136,7 @@ def test_post_not_connected(http_client, http_request, network_manager, response
assert callback.called
args, kwargs = callback.call_args
assert kwargs["context"]["toto"] == 42
assert kwargs["context"]["query_id"] == 42
def test_post_not_connected_connection_failed(http_client, http_request, network_manager, response):

View File

@@ -65,7 +65,7 @@ def link(devices, controller, project):
{"node_id": devices[0].node_id(), "adapter_number": 0, "port_number": 0},
{"node_id": devices[1].node_id(), "adapter_number": 0, "port_number": 0}
],
"link_style": {},
"link_style": {'color': '#000000', 'width': 2, 'type': 1},
"filters": {},
}
@@ -90,7 +90,7 @@ def test_create_link(devices, project, controller):
{"node_id": devices[0].node_id(), "adapter_number": 0, "port_number": 0},
{"node_id": devices[1].node_id(), "adapter_number": 0, "port_number": 0},
],
"link_style": {},
"link_style": {'color': '#000000', 'width': 2, 'type': 1},
"filters": {},
}