mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
style: sort imports in remaining tests and scripts
This commit is contained in:
1 parent
6d16d923c7
commit
83e7fbe63b
22 files changed
+68
-65
No files matched your search
@@ -6,9 +6,9 @@ device_config_send / device_show_run / vpcs_config_set.
|
||||
"""
|
||||
|
||||
import json
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
VPCS_MOD = "gns3server.agent.gns3_copilot.tools_v2.vpcs_tools_netmiko"
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ Tests that handlers correctly transform tool parameters into HTTP calls.
|
||||
"""
|
||||
|
||||
import json
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
|
||||
def _mock_conn(json_result=None):
|
||||
@@ -222,6 +222,7 @@ class TestNode:
|
||||
|
||||
def test_create_batch_preserves_submission_order(self, ctx):
|
||||
import time
|
||||
|
||||
from gns3server.agent.gns3_copilot.gns3_client.api_handlers import create_node_handler
|
||||
|
||||
with patch(f"{AH}._get_connector") as m:
|
||||
@@ -249,6 +250,7 @@ class TestNode:
|
||||
def test_create_batch_default_names_created_sequentially(self, ctx):
|
||||
import threading
|
||||
import time
|
||||
|
||||
from gns3server.agent.gns3_copilot.gns3_client.api_handlers import create_node_handler
|
||||
|
||||
def _run(nodes_param):
|
||||
@@ -502,6 +504,7 @@ class TestLink:
|
||||
|
||||
def test_create_batch_preserves_submission_order(self, ctx):
|
||||
import time
|
||||
|
||||
from gns3server.agent.gns3_copilot.gns3_client.api_handlers import create_link_handler
|
||||
|
||||
with patch(f"{AH}._get_connector") as m:
|
||||
|
||||
@@ -27,7 +27,6 @@ Tests for the shared GNS3 REST client layer (gns3_copilot.gns3_client):
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
# ── project_inventory ────────────────────────────────────────────────────
|
||||
|
||||
|
||||
@@ -131,8 +130,8 @@ def test_device_ports_prefer_netmiko_field_over_tag(monkeypatch):
|
||||
the tag stays as fallback when the field is missing.
|
||||
"""
|
||||
pytest.importorskip("jwt", reason="ai-features extras not installed")
|
||||
from gns3server.agent.gns3_copilot.utils import get_gns3_device_port
|
||||
from gns3server.agent.gns3_copilot import gns3_client
|
||||
from gns3server.agent.gns3_copilot.utils import get_gns3_device_port
|
||||
|
||||
class _FakeTopology:
|
||||
def _run(self, project_id=None, jwt_token=None, url=None):
|
||||
@@ -164,8 +163,8 @@ def test_device_ports_prefer_netmiko_field_over_tag(monkeypatch):
|
||||
|
||||
def test_device_ports_error_without_any_device_type(monkeypatch):
|
||||
pytest.importorskip("jwt", reason="ai-features extras not installed")
|
||||
from gns3server.agent.gns3_copilot.utils import get_gns3_device_port
|
||||
from gns3server.agent.gns3_copilot import gns3_client
|
||||
from gns3server.agent.gns3_copilot.utils import get_gns3_device_port
|
||||
|
||||
class _FakeTopology:
|
||||
def _run(self, project_id=None, jwt_token=None, url=None):
|
||||
@@ -193,8 +192,8 @@ def test_device_ports_inject_default_credentials(monkeypatch):
|
||||
keep inheriting from the group.
|
||||
"""
|
||||
pytest.importorskip("jwt", reason="ai-features extras not installed")
|
||||
from gns3server.agent.gns3_copilot.utils import get_gns3_device_port
|
||||
from gns3server.agent.gns3_copilot import gns3_client
|
||||
from gns3server.agent.gns3_copilot.utils import get_gns3_device_port
|
||||
|
||||
class _FakeTopology:
|
||||
def _run(self, project_id=None, jwt_token=None, url=None):
|
||||
|
||||
@@ -301,9 +301,9 @@ class TestReloadSkillsValidation:
|
||||
"""
|
||||
|
||||
def test_invalid_injection_skill_is_dropped(self, tmp_path, monkeypatch):
|
||||
from gns3server.config import Config
|
||||
from gns3server.agent.gns3_copilot.skills import registry
|
||||
from gns3server.agent.gns3_copilot.skills.manager import SkillsManager
|
||||
from gns3server.config import Config
|
||||
|
||||
# SkillsManager derives its local path from <config_dir>/skills
|
||||
injection_dir = tmp_path / "skills" / "injection"
|
||||
|
||||
Reference in new issue
Block a user