Move registration API to configuration
[pti/o2.git] / tests / conftest.py
index 60f3d2e..a1655b4 100644 (file)
@@ -20,7 +20,7 @@ from o2ims.adapter.orm import metadata, start_o2ims_mappers
 # from o2ims.adapter.clients.orm_stx import start_o2ims_stx_mappers\r
 \r
 from o2app.adapter import unit_of_work\r
-from o2ims.views.ocloud_route import configure_namespace\r
+from o2ims.views import configure_namespace\r
 \r
 from o2app.bootstrap import bootstrap\r
 \r
@@ -36,12 +36,11 @@ def mock_uow():
 def mock_flask_uow(mock_uow):\r
     session, uow = mock_uow\r
     app = Flask(__name__)\r
-    app.config["TESTING"] = True\r
+    app.config["TESTING"] = True\r
     api = Api(app)\r
-    bus = bootstrap(False, uow)\r
-    configure_namespace(api, bus)\r
-    client = app.test_client()\r
-    return session, client\r
+    bootstrap(False, uow)\r
+    configure_namespace(api)\r
+    return session, app\r
 \r
 \r
 @pytest.fixture\r
@@ -74,11 +73,11 @@ def sqlite_uow(sqlite_session_factory):
 @pytest.fixture\r
 def sqlite_flask_uow(sqlite_uow):\r
     app = Flask(__name__)\r
-    app.config["TESTING"] = True\r
+    app.config["TESTING"] = True\r
     api = Api(app)\r
-    bus = bootstrap(False, sqlite_uow)\r
-    configure_namespace(api, bus)\r
-    yield app.test_client()\r
+    bootstrap(False, sqlite_uow)\r
+    configure_namespace(api)\r
+    yield sqlite_uow, app\r
 \r
 \r
 @pytest.fixture\r
@@ -134,10 +133,11 @@ def postgres_uow(postgres_session_factory):
 @pytest.fixture\r
 def postgres_flask_uow(postgres_uow):\r
     app = Flask(__name__)\r
+    app.config["TESTING"] = True\r
     api = Api(app)\r
-    bus = bootstrap(False, postgres_uow)\r
-    configure_namespace(api, bus)\r
-    yield app.test_client()\r
+    bootstrap(False, postgres_uow)\r
+    configure_namespace(api)\r
+    yield postgres_uow, app\r
 \r
 \r
 @pytest.fixture\r