From aab944fb6c859d2e9bdfdeaf775049ca200c3b96 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Wed, 14 Jan 2015 11:43:23 +0100 Subject: [PATCH] Move old test to old_tests directory --- docs/api/examples/get_version.txt | 4 ++-- docs/api/examples/post_version.txt | 8 ++++---- gns3server/handlers/__init__.py | 1 + gns3server/server.py | 5 ++--- {tests => old_tests}/dynamips/.gitignore | 0 {tests => old_tests}/dynamips/conftest.py | 0 {tests => old_tests}/dynamips/dynamips.stable | Bin {tests => old_tests}/dynamips/test_atm_bridge.py | 0 {tests => old_tests}/dynamips/test_atm_switch.py | 0 {tests => old_tests}/dynamips/test_bridge.py | 0 {tests => old_tests}/dynamips/test_c1700.py | 0 {tests => old_tests}/dynamips/test_c2600.py | 0 {tests => old_tests}/dynamips/test_c2691.py | 0 {tests => old_tests}/dynamips/test_c3600.py | 0 {tests => old_tests}/dynamips/test_c3725.py | 0 {tests => old_tests}/dynamips/test_c3745.py | 0 {tests => old_tests}/dynamips/test_c7200.py | 0 .../dynamips/test_ethernet_switch.py | 0 .../dynamips/test_frame_relay_switch.py | 0 {tests => old_tests}/dynamips/test_hub.py | 0 {tests => old_tests}/dynamips/test_hypervisor.py | 0 .../dynamips/test_hypervisor_manager.py | 0 {tests => old_tests}/dynamips/test_nios.py | 0 {tests => old_tests}/dynamips/test_router.py | 0 {tests => old_tests}/dynamips/test_vmhandler.py | 0 {tests => old_tests}/iou/test_iou_device.py | 0 {tests => old_tests}/test_jsonrpc.py | 0 {tests => old_tests}/test_version_handler.py | 0 {tests => old_tests}/vpcs/test_vpcs_device.py | 0 tests/api/test_version.py | 2 +- tox.ini | 3 +++ 31 files changed, 13 insertions(+), 10 deletions(-) rename {tests => old_tests}/dynamips/.gitignore (100%) rename {tests => old_tests}/dynamips/conftest.py (100%) rename {tests => old_tests}/dynamips/dynamips.stable (100%) rename {tests => old_tests}/dynamips/test_atm_bridge.py (100%) rename {tests => old_tests}/dynamips/test_atm_switch.py (100%) rename {tests => old_tests}/dynamips/test_bridge.py (100%) rename {tests => old_tests}/dynamips/test_c1700.py (100%) rename {tests => old_tests}/dynamips/test_c2600.py (100%) rename {tests => old_tests}/dynamips/test_c2691.py (100%) rename {tests => old_tests}/dynamips/test_c3600.py (100%) rename {tests => old_tests}/dynamips/test_c3725.py (100%) rename {tests => old_tests}/dynamips/test_c3745.py (100%) rename {tests => old_tests}/dynamips/test_c7200.py (100%) rename {tests => old_tests}/dynamips/test_ethernet_switch.py (100%) rename {tests => old_tests}/dynamips/test_frame_relay_switch.py (100%) rename {tests => old_tests}/dynamips/test_hub.py (100%) rename {tests => old_tests}/dynamips/test_hypervisor.py (100%) rename {tests => old_tests}/dynamips/test_hypervisor_manager.py (100%) rename {tests => old_tests}/dynamips/test_nios.py (100%) rename {tests => old_tests}/dynamips/test_router.py (100%) rename {tests => old_tests}/dynamips/test_vmhandler.py (100%) rename {tests => old_tests}/iou/test_iou_device.py (100%) rename {tests => old_tests}/test_jsonrpc.py (100%) rename {tests => old_tests}/test_version_handler.py (100%) rename {tests => old_tests}/vpcs/test_vpcs_device.py (100%) diff --git a/docs/api/examples/get_version.txt b/docs/api/examples/get_version.txt index fc0a948e..3e711fce 100644 --- a/docs/api/examples/get_version.txt +++ b/docs/api/examples/get_version.txt @@ -6,12 +6,12 @@ GET /version HTTP/1.1 HTTP/1.1 200 CONNECTION: close -CONTENT-LENGTH: 31 +CONTENT-LENGTH: 29 CONTENT-TYPE: application/json DATE: Thu, 08 Jan 2015 16:09:15 GMT SERVER: Python/3.4 aiohttp/0.13.1 X-ROUTE: /version { - "version": "1.2.2.dev2" + "version": "1.3.dev1" } diff --git a/docs/api/examples/post_version.txt b/docs/api/examples/post_version.txt index 4ee7b50c..90ab4d81 100644 --- a/docs/api/examples/post_version.txt +++ b/docs/api/examples/post_version.txt @@ -1,19 +1,19 @@ -curl -i -xPOST 'http://localhost:8000/version' -d '{"version": "1.2.2.dev2"}' +curl -i -xPOST 'http://localhost:8000/version' -d '{"version": "1.3.dev1"}' POST /version HTTP/1.1 { - "version": "1.2.2.dev2" + "version": "1.3.dev1" } HTTP/1.1 200 CONNECTION: close -CONTENT-LENGTH: 31 +CONTENT-LENGTH: 29 CONTENT-TYPE: application/json DATE: Thu, 08 Jan 2015 16:09:15 GMT SERVER: Python/3.4 aiohttp/0.13.1 X-ROUTE: /version { - "version": "1.2.2.dev2" + "version": "1.3.dev1" } diff --git a/gns3server/handlers/__init__.py b/gns3server/handlers/__init__.py index e69de29b..60c6268d 100644 --- a/gns3server/handlers/__init__.py +++ b/gns3server/handlers/__init__.py @@ -0,0 +1 @@ +__all__ = ['version_handler', 'vpcs_handler'] diff --git a/gns3server/server.py b/gns3server/server.py index b3d5fbd2..12da8bfd 100644 --- a/gns3server/server.py +++ b/gns3server/server.py @@ -33,9 +33,8 @@ from .web.route import Route from .config import Config from .modules import MODULES -#FIXME: have something generic to automatically import handlers so the routes can be found -from .handlers.version_handler import VersionHandler -from .handlers.vpcs_handler import VPCSHandler +#TODO: get rid of * have something generic to automatically import handlers so the routes can be found +from gns3server.handlers import * import logging log = logging.getLogger(__name__) diff --git a/tests/dynamips/.gitignore b/old_tests/dynamips/.gitignore similarity index 100% rename from tests/dynamips/.gitignore rename to old_tests/dynamips/.gitignore diff --git a/tests/dynamips/conftest.py b/old_tests/dynamips/conftest.py similarity index 100% rename from tests/dynamips/conftest.py rename to old_tests/dynamips/conftest.py diff --git a/tests/dynamips/dynamips.stable b/old_tests/dynamips/dynamips.stable similarity index 100% rename from tests/dynamips/dynamips.stable rename to old_tests/dynamips/dynamips.stable diff --git a/tests/dynamips/test_atm_bridge.py b/old_tests/dynamips/test_atm_bridge.py similarity index 100% rename from tests/dynamips/test_atm_bridge.py rename to old_tests/dynamips/test_atm_bridge.py diff --git a/tests/dynamips/test_atm_switch.py b/old_tests/dynamips/test_atm_switch.py similarity index 100% rename from tests/dynamips/test_atm_switch.py rename to old_tests/dynamips/test_atm_switch.py diff --git a/tests/dynamips/test_bridge.py b/old_tests/dynamips/test_bridge.py similarity index 100% rename from tests/dynamips/test_bridge.py rename to old_tests/dynamips/test_bridge.py diff --git a/tests/dynamips/test_c1700.py b/old_tests/dynamips/test_c1700.py similarity index 100% rename from tests/dynamips/test_c1700.py rename to old_tests/dynamips/test_c1700.py diff --git a/tests/dynamips/test_c2600.py b/old_tests/dynamips/test_c2600.py similarity index 100% rename from tests/dynamips/test_c2600.py rename to old_tests/dynamips/test_c2600.py diff --git a/tests/dynamips/test_c2691.py b/old_tests/dynamips/test_c2691.py similarity index 100% rename from tests/dynamips/test_c2691.py rename to old_tests/dynamips/test_c2691.py diff --git a/tests/dynamips/test_c3600.py b/old_tests/dynamips/test_c3600.py similarity index 100% rename from tests/dynamips/test_c3600.py rename to old_tests/dynamips/test_c3600.py diff --git a/tests/dynamips/test_c3725.py b/old_tests/dynamips/test_c3725.py similarity index 100% rename from tests/dynamips/test_c3725.py rename to old_tests/dynamips/test_c3725.py diff --git a/tests/dynamips/test_c3745.py b/old_tests/dynamips/test_c3745.py similarity index 100% rename from tests/dynamips/test_c3745.py rename to old_tests/dynamips/test_c3745.py diff --git a/tests/dynamips/test_c7200.py b/old_tests/dynamips/test_c7200.py similarity index 100% rename from tests/dynamips/test_c7200.py rename to old_tests/dynamips/test_c7200.py diff --git a/tests/dynamips/test_ethernet_switch.py b/old_tests/dynamips/test_ethernet_switch.py similarity index 100% rename from tests/dynamips/test_ethernet_switch.py rename to old_tests/dynamips/test_ethernet_switch.py diff --git a/tests/dynamips/test_frame_relay_switch.py b/old_tests/dynamips/test_frame_relay_switch.py similarity index 100% rename from tests/dynamips/test_frame_relay_switch.py rename to old_tests/dynamips/test_frame_relay_switch.py diff --git a/tests/dynamips/test_hub.py b/old_tests/dynamips/test_hub.py similarity index 100% rename from tests/dynamips/test_hub.py rename to old_tests/dynamips/test_hub.py diff --git a/tests/dynamips/test_hypervisor.py b/old_tests/dynamips/test_hypervisor.py similarity index 100% rename from tests/dynamips/test_hypervisor.py rename to old_tests/dynamips/test_hypervisor.py diff --git a/tests/dynamips/test_hypervisor_manager.py b/old_tests/dynamips/test_hypervisor_manager.py similarity index 100% rename from tests/dynamips/test_hypervisor_manager.py rename to old_tests/dynamips/test_hypervisor_manager.py diff --git a/tests/dynamips/test_nios.py b/old_tests/dynamips/test_nios.py similarity index 100% rename from tests/dynamips/test_nios.py rename to old_tests/dynamips/test_nios.py diff --git a/tests/dynamips/test_router.py b/old_tests/dynamips/test_router.py similarity index 100% rename from tests/dynamips/test_router.py rename to old_tests/dynamips/test_router.py diff --git a/tests/dynamips/test_vmhandler.py b/old_tests/dynamips/test_vmhandler.py similarity index 100% rename from tests/dynamips/test_vmhandler.py rename to old_tests/dynamips/test_vmhandler.py diff --git a/tests/iou/test_iou_device.py b/old_tests/iou/test_iou_device.py similarity index 100% rename from tests/iou/test_iou_device.py rename to old_tests/iou/test_iou_device.py diff --git a/tests/test_jsonrpc.py b/old_tests/test_jsonrpc.py similarity index 100% rename from tests/test_jsonrpc.py rename to old_tests/test_jsonrpc.py diff --git a/tests/test_version_handler.py b/old_tests/test_version_handler.py similarity index 100% rename from tests/test_version_handler.py rename to old_tests/test_version_handler.py diff --git a/tests/vpcs/test_vpcs_device.py b/old_tests/vpcs/test_vpcs_device.py similarity index 100% rename from tests/vpcs/test_vpcs_device.py rename to old_tests/vpcs/test_vpcs_device.py diff --git a/tests/api/test_version.py b/tests/api/test_version.py index 178c0918..2ddc172e 100644 --- a/tests/api/test_version.py +++ b/tests/api/test_version.py @@ -51,7 +51,7 @@ def test_version_invalid_input_schema(server): assert response.status == 400 -@asyncio_patch("demoserver.handlers.version_handler.VersionHandler", return_value={}) +@asyncio_patch("gns3server.handlers.version_handler.VersionHandler", return_value={}) def test_version_invalid_output_schema(): query = {'version': "0.4.2"} response = server.post('/version', query) diff --git a/tox.ini b/tox.ini index 74d58489..50b5bb1b 100644 --- a/tox.ini +++ b/tox.ini @@ -8,3 +8,6 @@ deps = -rdev-requirements.txt [pep8] ignore = E501 +[pytest] +norecursedirs = old_tests +