diff --git a/test/integration/datagateway_api/db/conftest.py b/test/integration/datagateway_api/db/conftest.py index 154d1dd0..33e1e0f2 100644 --- a/test/integration/datagateway_api/db/conftest.py +++ b/test/integration/datagateway_api/db/conftest.py @@ -16,7 +16,9 @@ INVESTIGATION, INVESTIGATIONINSTRUMENT, ) -from test.datagateway_api.db.endpoints.test_create_db import TestDBCreateData +from test.integration.datagateway_api.db.endpoints.test_create_db import ( + TestDBCreateData, +) def set_meta_attributes(entity): diff --git a/test/integration/datagateway_api/db/endpoints/conftest.py b/test/integration/datagateway_api/db/endpoints/conftest.py new file mode 100644 index 00000000..667a9506 --- /dev/null +++ b/test/integration/datagateway_api/db/endpoints/conftest.py @@ -0,0 +1,50 @@ +from icat.query import Query +import pytest + + +@pytest.fixture() +def icat_query(icat_client): + return Query(icat_client, "Investigation") + + +@pytest.fixture() +def bad_credentials_header(): + return {"Authorization": "Bearer Invalid"} + + +@pytest.fixture() +def invalid_credentials_header(): + return {"Authorization": "Test"} + + +@pytest.fixture() +def test_config_data(): + return { + "datagateway_api": { + "extension": "/datagateway-api", + "backend": "db", + "client_cache_size": 5, + "client_pool_init_size": 2, + "client_pool_max_size": 5, + "db_url": "mysql+pymysql://icatdbuser:icatdbuserpw@localhost:3306/icatdb", + "icat_url": "https://localhost:8181", + "icat_check_cert": False, + }, + "search_api": { + "extension": "/search-api", + "icat_url": "https://localhost.testdomain:8181", + "icat_check_cert": True, + "mechanism": "anon", + "username": "", + "password": "", + }, + "flask_reloader": False, + "log_level": "WARN", + "log_location": "/home/runner/work/datagateway-api/datagateway-api/logs.log", + "debug_mode": False, + "generate_swagger": False, + "host": "127.0.0.1", + "port": "5000", + "test_user_credentials": {"username": "root", "password": "pw"}, + "test_mechanism": "simple", + } diff --git a/test/datagateway_api/db/endpoints/test_create_db.py b/test/integration/datagateway_api/db/endpoints/test_create_db.py similarity index 100% rename from test/datagateway_api/db/endpoints/test_create_db.py rename to test/integration/datagateway_api/db/endpoints/test_create_db.py diff --git a/test/datagateway_api/db/endpoints/test_delete_by_id_db.py b/test/integration/datagateway_api/db/endpoints/test_delete_by_id_db.py similarity index 100% rename from test/datagateway_api/db/endpoints/test_delete_by_id_db.py rename to test/integration/datagateway_api/db/endpoints/test_delete_by_id_db.py diff --git a/test/datagateway_api/db/endpoints/test_update_by_id_db.py b/test/integration/datagateway_api/db/endpoints/test_update_by_id_db.py similarity index 100% rename from test/datagateway_api/db/endpoints/test_update_by_id_db.py rename to test/integration/datagateway_api/db/endpoints/test_update_by_id_db.py diff --git a/test/datagateway_api/db/endpoints/test_update_multiple_db.py b/test/integration/datagateway_api/db/endpoints/test_update_multiple_db.py similarity index 100% rename from test/datagateway_api/db/endpoints/test_update_multiple_db.py rename to test/integration/datagateway_api/db/endpoints/test_update_multiple_db.py diff --git a/test/integration/datagateway_api/db/test_database_filter_utilities.py b/test/integration/datagateway_api/db/test_database_filter_utilities.py index cdc5aee1..a8a5ff4e 100644 --- a/test/integration/datagateway_api/db/test_database_filter_utilities.py +++ b/test/integration/datagateway_api/db/test_database_filter_utilities.py @@ -7,7 +7,7 @@ DatabaseWhereFilter, ) from datagateway_api.src.datagateway_api.database.helpers import ReadQuery -from test.datagateway_api.db.endpoints.test_create_db import ( +from test.integration.datagateway_api.db.endpoints.test_create_db import ( prepare_db_data_for_assertion, )