mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-10-28 11:12:26 +02:00
style: sort imports in compute and controller tests
This commit is contained in:
parent
b46b9a1d26
commit
6d16d923c7
@ -16,15 +16,15 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
|
from unittest.mock import MagicMock, call, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
import pytest_asyncio
|
||||||
from unittest.mock import MagicMock, patch, call
|
|
||||||
|
|
||||||
from gns3server.compute.builtin.nodes.cloud import Cloud
|
from gns3server.compute.builtin.nodes.cloud import Cloud
|
||||||
from gns3server.compute.nios.nio_udp import NIOUDP
|
from gns3server.compute.nios.nio_udp import NIOUDP
|
||||||
from tests.utils import asyncio_patch
|
from tests.utils import asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
pytestmark = pytest.mark.asyncio
|
pytestmark = pytest.mark.asyncio
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -16,13 +16,14 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import pytest
|
|
||||||
import pytest_asyncio
|
|
||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
from tests.utils import asyncio_patch, AsyncioMagicMock
|
import pytest
|
||||||
from gns3server.compute.docker import Docker, DOCKER_PREFERRED_API_VERSION, DOCKER_MINIMUM_API_VERSION
|
import pytest_asyncio
|
||||||
|
|
||||||
|
from gns3server.compute.docker import DOCKER_MINIMUM_API_VERSION, DOCKER_PREFERRED_API_VERSION, Docker
|
||||||
from gns3server.compute.docker.docker_error import DockerError, DockerHttp404Error
|
from gns3server.compute.docker.docker_error import DockerError, DockerHttp404Error
|
||||||
|
from tests.utils import AsyncioMagicMock, asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture
|
@pytest_asyncio.fixture
|
||||||
|
|||||||
@ -14,27 +14,24 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import aiohttp
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import pytest
|
|
||||||
import pytest_asyncio
|
|
||||||
import uuid
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import uuid
|
||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
from unittest.mock import patch
|
from unittest.mock import AsyncMock, MagicMock, call, patch
|
||||||
from tests.utils import asyncio_patch, AsyncioMagicMock
|
|
||||||
|
import aiohttp
|
||||||
|
import pytest
|
||||||
|
import pytest_asyncio
|
||||||
|
|
||||||
from gns3server.compute.ubridge.ubridge_error import UbridgeNamespaceError
|
|
||||||
from gns3server.compute.compute_error import ComputeError
|
from gns3server.compute.compute_error import ComputeError
|
||||||
from gns3server.compute.docker.docker_vm import DockerVM
|
|
||||||
from gns3server.compute.docker.docker_error import DockerError, DockerHttp404Error
|
|
||||||
from gns3server.compute.error import ImageMissingError
|
|
||||||
from gns3server.compute.docker import Docker
|
from gns3server.compute.docker import Docker
|
||||||
|
from gns3server.compute.docker.docker_error import DockerError, DockerHttp404Error
|
||||||
|
from gns3server.compute.docker.docker_vm import DockerVM
|
||||||
from unittest.mock import AsyncMock, patch, MagicMock, call
|
from gns3server.compute.error import ImageMissingError
|
||||||
|
from gns3server.compute.ubridge.ubridge_error import UbridgeNamespaceError
|
||||||
|
from tests.utils import AsyncioMagicMock, asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture
|
@pytest_asyncio.fixture
|
||||||
@ -2246,6 +2243,7 @@ def test_extra_config_schema_rejects_bad_targets():
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from pydantic import ValidationError
|
from pydantic import ValidationError
|
||||||
|
|
||||||
from gns3server.schemas.common import ExtraConfig
|
from gns3server.schemas.common import ExtraConfig
|
||||||
|
|
||||||
for bad in ("relative/path", "/has/../dots", "/", "/etc/", "no-leading-slash"):
|
for bad in ("relative/path", "/has/../dots", "/", "/etc/", "no-leading-slash"):
|
||||||
|
|||||||
@ -27,22 +27,19 @@ import glob
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
from unittest.mock import MagicMock, call, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
import pytest_asyncio
|
||||||
|
|
||||||
from unittest.mock import patch, MagicMock, call
|
|
||||||
|
|
||||||
from tests.utils import asyncio_patch, AsyncioMagicMock
|
|
||||||
|
|
||||||
from gns3server.compute.docker import Docker
|
from gns3server.compute.docker import Docker
|
||||||
from gns3server.compute.docker.docker_vm import DockerVM
|
|
||||||
from gns3server.compute.docker.vendor_docker_vm import VendorDockerVM
|
|
||||||
from gns3server.compute.docker.iol_docker_vm import IOLDockerVM
|
|
||||||
from gns3server.compute.docker.docker_error import DockerError
|
from gns3server.compute.docker.docker_error import DockerError
|
||||||
|
from gns3server.compute.docker.docker_vm import DockerVM
|
||||||
|
from gns3server.compute.docker.iol_docker_vm import IOLDockerVM
|
||||||
|
from gns3server.compute.docker.vendor_docker_vm import VendorDockerVM
|
||||||
from gns3server.compute.iou.utils.iou_export import nvram_export
|
from gns3server.compute.iou.utils.iou_export import nvram_export
|
||||||
from gns3server.compute.iou.utils.iou_import import nvram_import
|
from gns3server.compute.iou.utils.iou_import import nvram_import
|
||||||
|
from tests.utils import AsyncioMagicMock, asyncio_patch
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Helpers / fixtures
|
# Helpers / fixtures
|
||||||
|
|||||||
@ -30,21 +30,18 @@ These tests cover:
|
|||||||
* the container-side _fix_permissions passes.
|
* the container-side _fix_permissions passes.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import uuid
|
|
||||||
import os
|
import os
|
||||||
|
import uuid
|
||||||
|
from unittest.mock import MagicMock, call, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
import pytest_asyncio
|
||||||
|
|
||||||
from unittest.mock import patch, MagicMock, call
|
|
||||||
|
|
||||||
from tests.utils import asyncio_patch, AsyncioMagicMock
|
|
||||||
|
|
||||||
from gns3server.compute.docker import Docker
|
from gns3server.compute.docker import Docker
|
||||||
|
from gns3server.compute.docker.docker_error import DockerError, DockerHttp404Error
|
||||||
from gns3server.compute.docker.docker_vm import DockerVM
|
from gns3server.compute.docker.docker_vm import DockerVM
|
||||||
from gns3server.compute.docker.vendor_docker_vm import VendorDockerVM, _LazyExecTelnetServer
|
from gns3server.compute.docker.vendor_docker_vm import VendorDockerVM, _LazyExecTelnetServer
|
||||||
from gns3server.compute.docker.docker_error import DockerError, DockerHttp404Error
|
from tests.utils import AsyncioMagicMock, asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Helpers / fixtures
|
# Helpers / fixtures
|
||||||
|
|||||||
@ -15,16 +15,17 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
import pytest
|
import os
|
||||||
import pytest_asyncio
|
|
||||||
import tempfile
|
import tempfile
|
||||||
import uuid
|
import uuid
|
||||||
import os
|
from unittest.mock import patch
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
import pytest_asyncio
|
||||||
|
|
||||||
from gns3server.compute.dynamips import Dynamips
|
from gns3server.compute.dynamips import Dynamips
|
||||||
from gns3server.compute.dynamips.dynamips_error import DynamipsError
|
from gns3server.compute.dynamips.dynamips_error import DynamipsError
|
||||||
from unittest.mock import patch
|
from tests.utils import AsyncioMagicMock, asyncio_patch
|
||||||
from tests.utils import asyncio_patch, AsyncioMagicMock
|
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture
|
@pytest_asyncio.fixture
|
||||||
|
|||||||
@ -16,12 +16,13 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
import pytest_asyncio
|
||||||
|
|
||||||
from gns3server.compute.dynamips.nodes.router import Router
|
|
||||||
from gns3server.compute.dynamips.dynamips_error import DynamipsError
|
|
||||||
from gns3server.compute.dynamips import Dynamips
|
from gns3server.compute.dynamips import Dynamips
|
||||||
|
from gns3server.compute.dynamips.dynamips_error import DynamipsError
|
||||||
|
from gns3server.compute.dynamips.nodes.router import Router
|
||||||
from gns3server.config import Config
|
from gns3server.config import Config
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -15,8 +15,8 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from tests.utils import AsyncioMagicMock
|
|
||||||
from gns3server.compute.nios.nio_udp import NIOUDP
|
from gns3server.compute.nios.nio_udp import NIOUDP
|
||||||
|
from tests.utils import AsyncioMagicMock
|
||||||
|
|
||||||
|
|
||||||
def test_mac_command():
|
def test_mac_command():
|
||||||
|
|||||||
@ -14,22 +14,22 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import pytest
|
|
||||||
import pytest_asyncio
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import os
|
import os
|
||||||
import stat
|
import shutil
|
||||||
import socket
|
import socket
|
||||||
|
import stat
|
||||||
import struct
|
import struct
|
||||||
import uuid
|
import uuid
|
||||||
import shutil
|
|
||||||
|
|
||||||
from tests.utils import asyncio_patch, AsyncioMagicMock
|
|
||||||
|
|
||||||
from unittest.mock import MagicMock, call
|
from unittest.mock import MagicMock, call
|
||||||
from gns3server.compute.iou.iou_vm import IOUL1KeepaliveProtocol, IOUVM
|
|
||||||
from gns3server.compute.iou.iou_error import IOUError
|
import pytest
|
||||||
|
import pytest_asyncio
|
||||||
|
|
||||||
from gns3server.compute.iou import IOU
|
from gns3server.compute.iou import IOU
|
||||||
|
from gns3server.compute.iou.iou_error import IOUError
|
||||||
|
from gns3server.compute.iou.iou_vm import IOUVM, IOUL1KeepaliveProtocol
|
||||||
|
from tests.utils import AsyncioMagicMock, asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture
|
@pytest_asyncio.fixture
|
||||||
|
|||||||
@ -16,11 +16,11 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from gns3server.compute.marker.marker_manager import MarkerManager
|
|
||||||
from gns3server.compute.marker.marker_listener import MarkerListener
|
from gns3server.compute.marker.marker_listener import MarkerListener
|
||||||
|
from gns3server.compute.marker.marker_manager import MarkerManager
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Registry
|
# Registry
|
||||||
|
|||||||
@ -16,9 +16,10 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import pytest
|
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from gns3server.compute.qemu.utils.qcow2 import Qcow2, Qcow2Error
|
from gns3server.compute.qemu.utils.qcow2 import Qcow2, Qcow2Error
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -15,17 +15,17 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import stat
|
|
||||||
import pytest
|
|
||||||
import platform
|
import platform
|
||||||
|
import stat
|
||||||
import sys
|
import sys
|
||||||
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from gns3server.compute.qemu import Qemu
|
from gns3server.compute.qemu import Qemu
|
||||||
from gns3server.compute.qemu.qemu_error import QemuError
|
from gns3server.compute.qemu.qemu_error import QemuError
|
||||||
from tests.utils import asyncio_patch
|
from tests.utils import asyncio_patch
|
||||||
|
|
||||||
from unittest.mock import patch, MagicMock
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def fake_qemu_img_binary(tmpdir):
|
def fake_qemu_img_binary(tmpdir):
|
||||||
|
|||||||
@ -14,23 +14,22 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import pytest
|
|
||||||
import pytest_asyncio
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import os
|
import os
|
||||||
import stat
|
import stat
|
||||||
import sys
|
import sys
|
||||||
from tests.utils import asyncio_patch, AsyncioMagicMock
|
|
||||||
|
|
||||||
|
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
from unittest.mock import patch, MagicMock
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
import pytest_asyncio
|
||||||
|
|
||||||
from gns3server.compute.qemu.qemu_vm import QemuVM
|
|
||||||
from gns3server.compute.qemu.qemu_error import QemuError
|
|
||||||
from gns3server.compute.qemu import Qemu
|
|
||||||
from gns3server.utils import force_unix_path, macaddress_to_int, int_to_macaddress
|
|
||||||
from gns3server.compute.notification_manager import NotificationManager
|
from gns3server.compute.notification_manager import NotificationManager
|
||||||
|
from gns3server.compute.qemu import Qemu
|
||||||
|
from gns3server.compute.qemu.qemu_error import QemuError
|
||||||
|
from gns3server.compute.qemu.qemu_vm import QemuVM
|
||||||
|
from gns3server.utils import force_unix_path, int_to_macaddress, macaddress_to_int
|
||||||
|
from tests.utils import AsyncioMagicMock, asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture
|
@pytest_asyncio.fixture
|
||||||
|
|||||||
@ -17,19 +17,18 @@
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
import pytest_asyncio
|
||||||
|
|
||||||
from tests.utils import asyncio_patch, AsyncioMagicMock
|
|
||||||
from unittest.mock import patch, MagicMock
|
|
||||||
|
|
||||||
from gns3server.compute.compute_error import ComputeError
|
from gns3server.compute.compute_error import ComputeError
|
||||||
from gns3server.compute.vpcs.vpcs_vm import VPCSVM
|
|
||||||
from gns3server.compute.docker.docker_vm import DockerVM
|
from gns3server.compute.docker.docker_vm import DockerVM
|
||||||
from gns3server.compute.error import NodeError
|
from gns3server.compute.error import NodeError
|
||||||
from gns3server.compute.vpcs import VPCS
|
|
||||||
from gns3server.compute.nios.nio_udp import NIOUDP
|
from gns3server.compute.nios.nio_udp import NIOUDP
|
||||||
|
from gns3server.compute.vpcs import VPCS
|
||||||
|
from gns3server.compute.vpcs.vpcs_vm import VPCSVM
|
||||||
|
from tests.utils import AsyncioMagicMock, asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture(scope="function")
|
@pytest_asyncio.fixture(scope="function")
|
||||||
|
|||||||
@ -14,19 +14,20 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import uuid
|
|
||||||
import os
|
import os
|
||||||
|
import uuid
|
||||||
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
import pytest_asyncio
|
||||||
from unittest.mock import patch, MagicMock
|
|
||||||
from tests.utils import asyncio_patch
|
|
||||||
|
|
||||||
from gns3server.compute.vpcs import VPCS
|
|
||||||
from gns3server.compute.dynamips import Dynamips
|
|
||||||
from gns3server.compute.qemu import Qemu
|
|
||||||
from gns3server.compute.error import NodeError, ImageMissingError
|
|
||||||
from gns3server.compute.compute_error import ComputeError
|
from gns3server.compute.compute_error import ComputeError
|
||||||
|
from gns3server.compute.dynamips import Dynamips
|
||||||
|
from gns3server.compute.error import ImageMissingError, NodeError
|
||||||
|
from gns3server.compute.qemu import Qemu
|
||||||
|
from gns3server.compute.vpcs import VPCS
|
||||||
from gns3server.utils import force_unix_path
|
from gns3server.utils import force_unix_path
|
||||||
|
from tests.utils import asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture(scope="function")
|
@pytest_asyncio.fixture(scope="function")
|
||||||
|
|||||||
@ -15,9 +15,10 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import pytest
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from gns3server.compute.notification_manager import NotificationManager
|
from gns3server.compute.notification_manager import NotificationManager
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -14,13 +14,13 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import pytest
|
|
||||||
import threading
|
import threading
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from fastapi import HTTPException
|
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
from fastapi import HTTPException
|
||||||
|
|
||||||
from gns3server.compute.port_manager import PortManager
|
from gns3server.compute.port_manager import PortManager
|
||||||
from gns3server.compute.project import Project
|
from gns3server.compute.project import Project
|
||||||
|
|
||||||
|
|||||||
@ -17,16 +17,17 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
from unittest.mock import patch
|
||||||
|
from uuid import uuid4
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
import pytest_asyncio
|
||||||
from uuid import uuid4
|
|
||||||
from unittest.mock import patch
|
|
||||||
|
|
||||||
from tests.utils import asyncio_patch
|
|
||||||
from gns3server.compute.project import Project
|
|
||||||
from gns3server.compute.notification_manager import NotificationManager
|
|
||||||
from gns3server.compute.compute_error import ComputeError, ComputeForbiddenError
|
from gns3server.compute.compute_error import ComputeError, ComputeForbiddenError
|
||||||
|
from gns3server.compute.notification_manager import NotificationManager
|
||||||
|
from gns3server.compute.project import Project
|
||||||
from gns3server.compute.vpcs import VPCS, VPCSVM
|
from gns3server.compute.vpcs import VPCS, VPCSVM
|
||||||
|
from tests.utils import asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture(scope="function")
|
@pytest_asyncio.fixture(scope="function")
|
||||||
|
|||||||
@ -22,13 +22,13 @@ transport (AF_UNIX ``-U`` vs TCP ``-H``), command building, the human-readable
|
|||||||
immediately-exiting uBridge process (e.g. an old build that rejects ``-U``).
|
immediately-exiting uBridge process (e.g. an old build that rejects ``-U``).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import stat
|
import stat
|
||||||
import logging
|
from unittest.mock import AsyncMock, MagicMock, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from unittest.mock import MagicMock, AsyncMock, patch
|
|
||||||
|
|
||||||
from gns3server.compute.ubridge.hypervisor import Hypervisor
|
from gns3server.compute.ubridge.hypervisor import Hypervisor
|
||||||
from gns3server.compute.ubridge.ubridge_error import UbridgeError
|
from gns3server.compute.ubridge.ubridge_error import UbridgeError
|
||||||
|
|||||||
@ -15,14 +15,14 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
import pytest_asyncio
|
|
||||||
import tempfile
|
|
||||||
import os
|
import os
|
||||||
import stat
|
import stat
|
||||||
|
import tempfile
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
import pytest_asyncio
|
||||||
|
|
||||||
from gns3server.compute.virtualbox import VirtualBox
|
from gns3server.compute.virtualbox import VirtualBox
|
||||||
from gns3server.compute.virtualbox.virtualbox_error import VirtualBoxError
|
from gns3server.compute.virtualbox.virtualbox_error import VirtualBoxError
|
||||||
from tests.utils import asyncio_patch
|
from tests.utils import asyncio_patch
|
||||||
|
|||||||
@ -15,13 +15,14 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
import pytest_asyncio
|
||||||
from tests.utils import asyncio_patch, AsyncioMagicMock
|
|
||||||
|
|
||||||
from gns3server.compute.virtualbox.virtualbox_vm import VirtualBoxVM
|
|
||||||
from gns3server.compute.virtualbox.virtualbox_error import VirtualBoxError
|
|
||||||
from gns3server.compute.virtualbox import VirtualBox
|
from gns3server.compute.virtualbox import VirtualBox
|
||||||
|
from gns3server.compute.virtualbox.virtualbox_error import VirtualBoxError
|
||||||
|
from gns3server.compute.virtualbox.virtualbox_vm import VirtualBoxVM
|
||||||
|
from tests.utils import AsyncioMagicMock, asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture
|
@pytest_asyncio.fixture
|
||||||
|
|||||||
@ -17,8 +17,8 @@
|
|||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
import pytest_asyncio
|
||||||
|
|
||||||
from gns3server.compute.vmware.vmware_vm import VMwareVM
|
|
||||||
from gns3server.compute.vmware import VMware
|
from gns3server.compute.vmware import VMware
|
||||||
|
from gns3server.compute.vmware.vmware_vm import VMwareVM
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture
|
@pytest_asyncio.fixture
|
||||||
|
|||||||
@ -15,13 +15,13 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from gns3server.compute.project_manager import ProjectManager
|
||||||
from gns3server.compute.vpcs import VPCS
|
from gns3server.compute.vpcs import VPCS
|
||||||
from gns3server.compute.vpcs.vpcs_error import VPCSError
|
from gns3server.compute.vpcs.vpcs_error import VPCSError
|
||||||
from gns3server.compute.project_manager import ProjectManager
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
|
|||||||
@ -14,19 +14,19 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import pytest
|
|
||||||
import pytest_asyncio
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import os
|
import os
|
||||||
|
from unittest.mock import ANY, MagicMock, patch
|
||||||
|
|
||||||
from tests.utils import asyncio_patch, AsyncioMagicMock
|
import pytest
|
||||||
from gns3server.utils import parse_version
|
import pytest_asyncio
|
||||||
from unittest.mock import patch, MagicMock, ANY
|
|
||||||
|
|
||||||
from gns3server.compute.vpcs.vpcs_vm import VPCSVM
|
|
||||||
from gns3server.compute.vpcs.vpcs_error import VPCSError
|
|
||||||
from gns3server.compute.vpcs import VPCS
|
|
||||||
from gns3server.compute.notification_manager import NotificationManager
|
from gns3server.compute.notification_manager import NotificationManager
|
||||||
|
from gns3server.compute.vpcs import VPCS
|
||||||
|
from gns3server.compute.vpcs.vpcs_error import VPCSError
|
||||||
|
from gns3server.compute.vpcs.vpcs_vm import VPCSVM
|
||||||
|
from gns3server.utils import parse_version
|
||||||
|
from tests.utils import AsyncioMagicMock, asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture
|
@pytest_asyncio.fixture
|
||||||
|
|||||||
@ -16,11 +16,11 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from gns3server.controller.gns3vm.remote_gns3_vm import RemoteGNS3VM
|
|
||||||
from gns3server.controller.gns3vm.gns3_vm_error import GNS3VMError
|
|
||||||
from pydantic import SecretStr
|
from pydantic import SecretStr
|
||||||
|
|
||||||
|
from gns3server.controller.gns3vm.gns3_vm_error import GNS3VMError
|
||||||
|
from gns3server.controller.gns3vm.remote_gns3_vm import RemoteGNS3VM
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def gns3vm(controller):
|
def gns3vm(controller):
|
||||||
|
|||||||
@ -18,10 +18,9 @@
|
|||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
import pytest_asyncio
|
||||||
|
|
||||||
from tests.utils import asyncio_patch
|
|
||||||
from gns3server.utils.asyncio import wait_run_in_executor
|
|
||||||
|
|
||||||
from gns3server.controller.gns3vm.virtualbox_gns3_vm import VirtualBoxGNS3VM
|
from gns3server.controller.gns3vm.virtualbox_gns3_vm import VirtualBoxGNS3VM
|
||||||
|
from gns3server.utils.asyncio import wait_run_in_executor
|
||||||
|
from tests.utils import asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture
|
@pytest_asyncio.fixture
|
||||||
|
|||||||
@ -22,7 +22,6 @@ from gns3server.controller.appliance import Appliance
|
|||||||
from gns3server.controller.appliance_to_template import ApplianceToTemplate
|
from gns3server.controller.appliance_to_template import ApplianceToTemplate
|
||||||
from gns3server.schemas.controller.appliances import ApplianceModel
|
from gns3server.schemas.controller.appliances import ApplianceModel
|
||||||
|
|
||||||
|
|
||||||
# v8 mirror of the XRd Control Plane appliance shape (docker, custom_adapters, no versions)
|
# v8 mirror of the XRd Control Plane appliance shape (docker, custom_adapters, no versions)
|
||||||
XRD_V8 = {
|
XRD_V8 = {
|
||||||
"registry_version": 8,
|
"registry_version": 8,
|
||||||
|
|||||||
@ -16,6 +16,7 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from gns3server.controller.appliance import Appliance
|
from gns3server.controller.appliance import Appliance
|
||||||
|
|||||||
@ -15,14 +15,13 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import pytest
|
|
||||||
import pydantic
|
import pydantic
|
||||||
|
import pytest
|
||||||
|
|
||||||
from gns3server.controller.appliance_to_template import ApplianceToTemplate
|
from gns3server.controller.appliance_to_template import ApplianceToTemplate
|
||||||
from gns3server.controller.controller_error import ControllerError
|
from gns3server.controller.controller_error import ControllerError
|
||||||
from gns3server.schemas.controller.appliances import ApplianceModel
|
from gns3server.schemas.controller.appliances import ApplianceModel
|
||||||
|
|
||||||
|
|
||||||
# reduced mirror of the upstream vyos.gns3a (registry version 8, qemu, 2 settings sets)
|
# reduced mirror of the upstream vyos.gns3a (registry version 8, qemu, 2 settings sets)
|
||||||
VYOS_V8 = {
|
VYOS_V8 = {
|
||||||
"registry_version": 8,
|
"registry_version": 8,
|
||||||
|
|||||||
@ -15,25 +15,26 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import sys
|
|
||||||
import json
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
import json
|
||||||
|
import sys
|
||||||
|
from types import SimpleNamespace
|
||||||
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import pytest
|
import pytest
|
||||||
from types import SimpleNamespace
|
from pydantic import SecretStr
|
||||||
from unittest.mock import patch, MagicMock
|
|
||||||
|
|
||||||
from gns3server.controller.project import Project
|
|
||||||
from gns3server.controller.compute import Compute
|
|
||||||
from gns3server.api.server import app as gns3_app
|
from gns3server.api.server import app as gns3_app
|
||||||
|
from gns3server.controller.compute import Compute
|
||||||
from gns3server.controller.controller_error import (
|
from gns3server.controller.controller_error import (
|
||||||
|
ComputeConflictError,
|
||||||
ControllerError,
|
ControllerError,
|
||||||
ControllerNotFoundError,
|
ControllerNotFoundError,
|
||||||
ControllerUnauthorizedError,
|
ControllerUnauthorizedError,
|
||||||
ComputeConflictError,
|
|
||||||
)
|
)
|
||||||
from pydantic import SecretStr
|
from gns3server.controller.project import Project
|
||||||
from tests.utils import asyncio_patch, AsyncioMagicMock
|
from tests.utils import AsyncioMagicMock, asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|||||||
@ -15,21 +15,21 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import os
|
|
||||||
import uuid
|
|
||||||
import json
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import pytest
|
import json
|
||||||
|
import os
|
||||||
import socket
|
import socket
|
||||||
|
import uuid
|
||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import MagicMock, patch
|
||||||
from tests.utils import AsyncioMagicMock, asyncio_patch
|
|
||||||
from watchdog.events import FileCreatedEvent, DirCreatedEvent
|
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
from watchdog.events import DirCreatedEvent, FileCreatedEvent
|
||||||
|
|
||||||
|
from gns3server.controller import _ProjectsDirectoryEventHandler
|
||||||
from gns3server.controller.compute import Compute
|
from gns3server.controller.compute import Compute
|
||||||
from gns3server.controller.controller_error import ControllerError, ControllerNotFoundError
|
from gns3server.controller.controller_error import ControllerError, ControllerNotFoundError
|
||||||
from gns3server.controller import _ProjectsDirectoryEventHandler
|
|
||||||
from gns3server.version import __version__
|
from gns3server.version import __version__
|
||||||
|
from tests.utils import AsyncioMagicMock, asyncio_patch
|
||||||
|
|
||||||
# def test_save(controller, controller_config_path):
|
# def test_save(controller, controller_config_path):
|
||||||
#
|
#
|
||||||
|
|||||||
@ -15,14 +15,14 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from unittest.mock import MagicMock
|
|
||||||
import pytest
|
|
||||||
import uuid
|
|
||||||
import os
|
import os
|
||||||
|
import uuid
|
||||||
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
from tests.utils import AsyncioMagicMock
|
import pytest
|
||||||
|
|
||||||
from gns3server.controller.drawing import Drawing
|
from gns3server.controller.drawing import Drawing
|
||||||
|
from tests.utils import AsyncioMagicMock
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|||||||
@ -16,22 +16,21 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
import os
|
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
|
import stat
|
||||||
|
import zipfile
|
||||||
|
from pathlib import Path
|
||||||
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
import pytest_asyncio
|
||||||
import zipfile
|
|
||||||
import stat
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
from unittest.mock import patch
|
|
||||||
from unittest.mock import MagicMock
|
|
||||||
from tests.utils import AsyncioMagicMock, AsyncioBytesIO
|
|
||||||
|
|
||||||
from gns3server.controller.project import Project
|
|
||||||
from gns3server.controller.export_project import export_project, _is_exportable
|
|
||||||
from gns3server.utils.asyncio import aiozipstream
|
|
||||||
from gns3server.controller.controller_error import ControllerError
|
from gns3server.controller.controller_error import ControllerError
|
||||||
|
from gns3server.controller.export_project import _is_exportable, export_project
|
||||||
|
from gns3server.controller.project import Project
|
||||||
|
from gns3server.utils.asyncio import aiozipstream
|
||||||
|
from tests.utils import AsyncioBytesIO, AsyncioMagicMock
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture
|
@pytest_asyncio.fixture
|
||||||
|
|||||||
@ -15,13 +15,14 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import pytest
|
|
||||||
import sys
|
import sys
|
||||||
from tests.utils import asyncio_patch, AsyncioMagicMock
|
|
||||||
|
import pytest
|
||||||
|
from pydantic import SecretStr
|
||||||
|
|
||||||
from gns3server.controller.gns3vm import GNS3VM
|
from gns3server.controller.gns3vm import GNS3VM
|
||||||
from gns3server.controller.gns3vm.gns3_vm_error import GNS3VMError
|
from gns3server.controller.gns3vm.gns3_vm_error import GNS3VMError
|
||||||
from pydantic import SecretStr
|
from tests.utils import AsyncioMagicMock, asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|||||||
@ -15,23 +15,22 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import pytest
|
import json
|
||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
import json
|
|
||||||
import zipfile
|
import zipfile
|
||||||
|
from pathlib import Path
|
||||||
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
from tests.utils import asyncio_patch, AsyncioMagicMock
|
|
||||||
from unittest.mock import patch, MagicMock
|
|
||||||
|
|
||||||
from gns3server.utils.asyncio import aiozipstream
|
|
||||||
from gns3server.controller.project import Project
|
|
||||||
from gns3server.controller.controller_error import ControllerError
|
from gns3server.controller.controller_error import ControllerError
|
||||||
from gns3server.controller.export_project import export_project
|
from gns3server.controller.export_project import export_project
|
||||||
from gns3server.controller.import_project import import_project, _move_files_to_compute
|
from gns3server.controller.import_project import _move_files_to_compute, import_project
|
||||||
|
from gns3server.controller.project import Project
|
||||||
|
from gns3server.utils.asyncio import aiozipstream
|
||||||
from gns3server.version import __version__
|
from gns3server.version import __version__
|
||||||
|
from tests.utils import AsyncioMagicMock, asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
|
|||||||
@ -15,15 +15,16 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import pytest
|
|
||||||
import pytest_asyncio
|
|
||||||
from unittest.mock import MagicMock
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
import pytest_asyncio
|
||||||
|
|
||||||
|
from gns3server.controller.controller_error import ControllerError
|
||||||
from gns3server.controller.link import Link
|
from gns3server.controller.link import Link
|
||||||
from gns3server.controller.node import Node
|
from gns3server.controller.node import Node
|
||||||
from gns3server.controller.ports.ethernet_port import EthernetPort
|
from gns3server.controller.ports.ethernet_port import EthernetPort
|
||||||
from gns3server.controller.ports.serial_port import SerialPort
|
from gns3server.controller.ports.serial_port import SerialPort
|
||||||
from gns3server.controller.controller_error import ControllerError
|
|
||||||
from tests.utils import AsyncioBytesIO, AsyncioMagicMock
|
from tests.utils import AsyncioBytesIO, AsyncioMagicMock
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -25,18 +25,17 @@ Controller-layer tests for the traffic-insight marker feature:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
|
from contextlib import ExitStack
|
||||||
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from unittest.mock import MagicMock, patch
|
|
||||||
from contextlib import ExitStack
|
|
||||||
|
|
||||||
from tests.utils import AsyncioMagicMock
|
from gns3server.controller.controller_error import ControllerError, ControllerNotFoundError
|
||||||
|
from gns3server.controller.node import Node
|
||||||
from gns3server.controller.udp_link import UDPLink
|
|
||||||
from gns3server.controller.ports.ethernet_port import EthernetPort
|
from gns3server.controller.ports.ethernet_port import EthernetPort
|
||||||
from gns3server.controller.ports.serial_port import SerialPort
|
from gns3server.controller.ports.serial_port import SerialPort
|
||||||
from gns3server.controller.node import Node
|
from gns3server.controller.udp_link import UDPLink
|
||||||
from gns3server.controller.controller_error import ControllerError, ControllerNotFoundError
|
from tests.utils import AsyncioMagicMock
|
||||||
|
|
||||||
|
|
||||||
def _valid_bpf():
|
def _valid_bpf():
|
||||||
|
|||||||
@ -43,25 +43,25 @@ from unittest.mock import patch
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from gns3server.controller import marker_replay
|
||||||
from gns3server.controller.controller_error import (
|
from gns3server.controller.controller_error import (
|
||||||
ControllerBadRequestError,
|
ControllerBadRequestError,
|
||||||
ControllerError,
|
ControllerError,
|
||||||
ControllerNotFoundError,
|
ControllerNotFoundError,
|
||||||
)
|
)
|
||||||
from gns3server.controller import marker_replay
|
|
||||||
from gns3server.controller.marker_replay import (
|
from gns3server.controller.marker_replay import (
|
||||||
FilterError,
|
FilterError,
|
||||||
SharkdError,
|
SharkdError,
|
||||||
SharkdMissingError,
|
SharkdMissingError,
|
||||||
|
_count_tree_nodes,
|
||||||
|
_format_ts,
|
||||||
|
_parse_ts,
|
||||||
|
_rename_value,
|
||||||
build_timeline,
|
build_timeline,
|
||||||
decode_frame,
|
decode_frame,
|
||||||
query_frames,
|
query_frames,
|
||||||
read_frame_bytes,
|
read_frame_bytes,
|
||||||
scan_pcap_frames,
|
scan_pcap_frames,
|
||||||
_count_tree_nodes,
|
|
||||||
_format_ts,
|
|
||||||
_parse_ts,
|
|
||||||
_rename_value,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
pytestmark = pytest.mark.asyncio
|
pytestmark = pytest.mark.asyncio
|
||||||
|
|||||||
@ -15,18 +15,18 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import shutil
|
|
||||||
import pytest
|
|
||||||
import uuid
|
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
|
import uuid
|
||||||
|
from unittest.mock import ANY, MagicMock
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from unittest.mock import MagicMock, ANY
|
|
||||||
from tests.utils import AsyncioMagicMock, asyncio_patch
|
|
||||||
from gns3server.compute.docker.docker_error import DockerError
|
from gns3server.compute.docker.docker_error import DockerError
|
||||||
|
from gns3server.controller.controller_error import ComputeConflictError, ControllerError
|
||||||
from gns3server.controller.node import Node
|
from gns3server.controller.node import Node
|
||||||
from gns3server.controller.project import Project
|
from gns3server.controller.project import Project
|
||||||
from gns3server.controller.controller_error import ComputeConflictError, ControllerError
|
from tests.utils import AsyncioMagicMock, asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|||||||
@ -15,13 +15,13 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import pytest
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from tests.utils import AsyncioMagicMock
|
import pytest
|
||||||
|
|
||||||
from gns3server.controller.node import Node
|
from gns3server.controller.node import Node
|
||||||
from gns3server.controller.ports.ethernet_port import EthernetPort
|
from gns3server.controller.ports.ethernet_port import EthernetPort
|
||||||
|
from tests.utils import AsyncioMagicMock
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|||||||
@ -15,9 +15,10 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import pytest_asyncio
|
import pytest_asyncio
|
||||||
from unittest.mock import MagicMock
|
|
||||||
|
|
||||||
from tests.utils import AsyncioMagicMock
|
from tests.utils import AsyncioMagicMock
|
||||||
|
|
||||||
|
|||||||
@ -15,26 +15,26 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import os
|
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
import pytest
|
from unittest.mock import MagicMock, patch
|
||||||
import pytest_asyncio
|
|
||||||
from unittest.mock import MagicMock
|
|
||||||
from tests.utils import AsyncioMagicMock, asyncio_patch
|
|
||||||
from unittest.mock import patch
|
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
from gns3server.controller.project import Project
|
import pytest
|
||||||
|
import pytest_asyncio
|
||||||
|
|
||||||
|
from gns3server.config import Config
|
||||||
|
from gns3server.controller.controller_error import (
|
||||||
|
ComputeConflictError,
|
||||||
|
ControllerError,
|
||||||
|
ControllerForbiddenError,
|
||||||
|
ControllerNotFoundError,
|
||||||
|
)
|
||||||
from gns3server.controller.node import Node
|
from gns3server.controller.node import Node
|
||||||
from gns3server.controller.ports.ethernet_port import EthernetPort
|
from gns3server.controller.ports.ethernet_port import EthernetPort
|
||||||
from gns3server.controller.controller_error import (
|
from gns3server.controller.project import Project
|
||||||
ControllerError,
|
from tests.utils import AsyncioMagicMock, asyncio_patch
|
||||||
ControllerNotFoundError,
|
|
||||||
ControllerForbiddenError,
|
|
||||||
ComputeConflictError,
|
|
||||||
)
|
|
||||||
from gns3server.config import Config
|
|
||||||
|
|
||||||
|
|
||||||
@pytest_asyncio.fixture
|
@pytest_asyncio.fixture
|
||||||
|
|||||||
@ -15,14 +15,14 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import os
|
|
||||||
import json
|
import json
|
||||||
import pytest
|
import os
|
||||||
|
|
||||||
from tests.utils import asyncio_patch
|
import pytest
|
||||||
|
|
||||||
from gns3server.controller.compute import Compute
|
from gns3server.controller.compute import Compute
|
||||||
from gns3server.controller.project import Project
|
from gns3server.controller.project import Project
|
||||||
|
from tests.utils import asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|||||||
@ -15,22 +15,22 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import pytest
|
|
||||||
import pytest_asyncio
|
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
import pytest_asyncio
|
||||||
from fastapi import FastAPI, status
|
from fastapi import FastAPI, status
|
||||||
from httpx import AsyncClient
|
from httpx import AsyncClient
|
||||||
from httpx_ws.transport import ASGIWebSocketTransport
|
from httpx_ws.transport import ASGIWebSocketTransport
|
||||||
|
|
||||||
from sqlalchemy.ext.asyncio import AsyncSession
|
from sqlalchemy.ext.asyncio import AsyncSession
|
||||||
|
|
||||||
from gns3server.controller import Controller
|
from gns3server.controller import Controller
|
||||||
|
from gns3server.db.models import User
|
||||||
|
from gns3server.db.repositories.pools import ResourcePoolsRepository
|
||||||
from gns3server.db.repositories.rbac import RbacRepository
|
from gns3server.db.repositories.rbac import RbacRepository
|
||||||
from gns3server.db.repositories.users import UsersRepository
|
from gns3server.db.repositories.users import UsersRepository
|
||||||
from gns3server.db.repositories.pools import ResourcePoolsRepository
|
|
||||||
from gns3server.schemas.controller.rbac import ACECreate
|
|
||||||
from gns3server.schemas.controller.pools import ResourceCreate, ResourcePoolCreate
|
from gns3server.schemas.controller.pools import ResourceCreate, ResourcePoolCreate
|
||||||
from gns3server.db.models import User
|
from gns3server.schemas.controller.rbac import ACECreate
|
||||||
from gns3server.services import auth_service
|
from gns3server.services import auth_service
|
||||||
|
|
||||||
pytestmark = pytest.mark.asyncio
|
pytestmark = pytest.mark.asyncio
|
||||||
|
|||||||
@ -16,13 +16,13 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from unittest import mock
|
||||||
|
from unittest.mock import MagicMock, patch
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from unittest import mock
|
|
||||||
from unittest.mock import patch, MagicMock
|
|
||||||
from gns3server.controller.snapshot import Snapshot
|
|
||||||
|
|
||||||
|
from gns3server.controller.snapshot import Snapshot
|
||||||
from tests.utils import AsyncioMagicMock
|
from tests.utils import AsyncioMagicMock
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from gns3server.controller.symbols import Symbols
|
|
||||||
from gns3server.controller.symbol_themes import BUILTIN_SYMBOL_THEMES
|
from gns3server.controller.symbol_themes import BUILTIN_SYMBOL_THEMES
|
||||||
|
from gns3server.controller.symbols import Symbols
|
||||||
from gns3server.utils.get_resource import get_resource
|
from gns3server.utils.get_resource import get_resource
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -17,15 +17,16 @@
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
import uuid
|
import uuid
|
||||||
import pytest
|
|
||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import MagicMock, patch
|
||||||
from tests.utils import asyncio_patch
|
|
||||||
|
|
||||||
from gns3server.controller.project import Project
|
import pytest
|
||||||
|
|
||||||
from gns3server.controller.compute import Compute
|
from gns3server.controller.compute import Compute
|
||||||
from gns3server.controller.topology import project_to_topology, load_topology, GNS3_FILE_FORMAT_REVISION
|
|
||||||
from gns3server.controller.controller_error import ControllerError
|
from gns3server.controller.controller_error import ControllerError
|
||||||
|
from gns3server.controller.project import Project
|
||||||
|
from gns3server.controller.topology import GNS3_FILE_FORMAT_REVISION, load_topology, project_to_topology
|
||||||
from gns3server.version import __version__
|
from gns3server.version import __version__
|
||||||
|
from tests.utils import asyncio_patch
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
|
|||||||
@ -15,14 +15,15 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import pytest
|
|
||||||
from unittest.mock import MagicMock
|
from unittest.mock import MagicMock
|
||||||
from tests.utils import AsyncioMagicMock
|
|
||||||
|
|
||||||
from gns3server.controller.udp_link import UDPLink
|
import pytest
|
||||||
from gns3server.controller.ports.ethernet_port import EthernetPort
|
|
||||||
from gns3server.controller.node import Node
|
|
||||||
from gns3server.controller.controller_error import ControllerError
|
from gns3server.controller.controller_error import ControllerError
|
||||||
|
from gns3server.controller.node import Node
|
||||||
|
from gns3server.controller.ports.ethernet_port import EthernetPort
|
||||||
|
from gns3server.controller.udp_link import UDPLink
|
||||||
|
from tests.utils import AsyncioMagicMock
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user