From a69d2b76393333714304b833b37a914db1accbc6 Mon Sep 17 00:00:00 2001 From: Maxime Alves LIRMM Date: Thu, 10 Feb 2022 12:30:49 +0100 Subject: [PATCH] =?UTF-8?q?[tests]=C2=A0async=20router=20renamed=20to=20as?= =?UTF-8?q?ync=5Frouter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../routers/{async => async_router}/__init__.py | 0 tests/test_dummy_domain.py | 7 +++---- tests/test_dummy_project_router.py | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) rename tests/dummy_domain/routers/{async => async_router}/__init__.py (100%) diff --git a/tests/dummy_domain/routers/async/__init__.py b/tests/dummy_domain/routers/async_router/__init__.py similarity index 100% rename from tests/dummy_domain/routers/async/__init__.py rename to tests/dummy_domain/routers/async_router/__init__.py diff --git a/tests/test_dummy_domain.py b/tests/test_dummy_domain.py index 56da1b1..8c9b757 100644 --- a/tests/test_dummy_domain.py +++ b/tests/test_dummy_domain.py @@ -13,7 +13,6 @@ def test_dummy_domain(): from .dummy_domain.routers.abc.alphabet.TEST_uuid import get from .dummy_domain.routers.abc.pinnochio import get from .dummy_domain.routers.config import get - async_mod = importlib.import_module('dummy_domain.routers.async', '.') - fcts = ['get_abc_alphabet_TEST', 'get_abc_pinnochio', 'get_config', 'get_arguments'] - for fct in fcts: - getattr(async_mod, fct) + from .dummy_domain.routers.config import get + from .dummy_domain.routers import async_router + from .dummy_domain.routers.async_router import ROUTES, get_abc_alphabet_TEST, get_abc_pinnochio, get_config, get_arguments diff --git a/tests/test_dummy_project_router.py b/tests/test_dummy_project_router.py index b99a1d4..ff47c30 100644 --- a/tests/test_dummy_project_router.py +++ b/tests/test_dummy_project_router.py @@ -24,8 +24,8 @@ def test_get_route(dummy_project, application_domain): dummy_domain_routes = [ ('config','GET'), ('config','GET'), - ('async/abc/pinnochio','GET'), - ('async/config','GET'), + ('async_router/abc/pinnochio','GET'), + ('async_router/config','GET'), # ('abc/pinnochio','GET'), # ('abc/alphabet','GET'), ] @@ -95,7 +95,7 @@ def test_arguments_route(dummy_project, application_domain): assert r.status_code == 200 for key, val in arg.items(): assert r.json()[key] == str(val) - path = '/async/arguments' + path = '/async_router/arguments' r = c.get(path) assert r.status_code == 400 r = c.get(path, params={'foo':True})