aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-08-07 07:58:09 +0300
committerFrederick Muriuki Muriithi2023-08-07 09:26:12 +0300
commit6d9c61dc0072b96b12153e64940b465306f25bfb (patch)
treea4957c7967e56b4527c1e926744a65a3326935ce /tests
parent6ab6d46ab4b1611ed72bdbce85cf9324ce69b305 (diff)
downloadgn-auth-6d9c61dc0072b96b12153e64940b465306f25bfb.tar.gz
Change imports to new unified db module.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/auth/fixtures/group_fixtures.py2
-rw-r--r--tests/unit/auth/fixtures/migration_fixtures.py2
-rw-r--r--tests/unit/auth/fixtures/oauth2_client_fixtures.py2
-rw-r--r--tests/unit/auth/fixtures/resource_fixtures.py2
-rw-r--r--tests/unit/auth/fixtures/role_fixtures.py2
-rw-r--r--tests/unit/auth/fixtures/user_fixtures.py2
-rw-r--r--tests/unit/auth/test_credentials.py2
-rw-r--r--tests/unit/auth/test_groups.py2
-rw-r--r--tests/unit/auth/test_migrations_add_data_to_table.py2
-rw-r--r--tests/unit/auth/test_migrations_add_remove_columns.py2
-rw-r--r--tests/unit/auth/test_migrations_create_tables.py2
-rw-r--r--tests/unit/auth/test_migrations_drop_tables.py2
-rw-r--r--tests/unit/auth/test_migrations_indexes.py2
-rw-r--r--tests/unit/auth/test_migrations_init_data_in_resource_categories_table.py2
-rw-r--r--tests/unit/auth/test_privileges.py2
-rw-r--r--tests/unit/auth/test_resources.py2
-rw-r--r--tests/unit/auth/test_roles.py2
-rw-r--r--tests/unit/auth/test_token.py2
18 files changed, 18 insertions, 18 deletions
diff --git a/tests/unit/auth/fixtures/group_fixtures.py b/tests/unit/auth/fixtures/group_fixtures.py
index b2bae24..c7775d9 100644
--- a/tests/unit/auth/fixtures/group_fixtures.py
+++ b/tests/unit/auth/fixtures/group_fixtures.py
@@ -3,7 +3,7 @@ import uuid
import pytest
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
from gn_auth.auth.authorisation.groups import Group, GroupRole
from gn_auth.auth.authorisation.resources import Resource, ResourceCategory
diff --git a/tests/unit/auth/fixtures/migration_fixtures.py b/tests/unit/auth/fixtures/migration_fixtures.py
index 2a67c01..16a31cd 100644
--- a/tests/unit/auth/fixtures/migration_fixtures.py
+++ b/tests/unit/auth/fixtures/migration_fixtures.py
@@ -4,7 +4,7 @@ from yoyo.backends import DatabaseBackend
from yoyo import get_backend, read_migrations
from yoyo.migrations import Migration, MigrationList
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
from gn_auth.migrations import apply_migrations, rollback_migrations
@pytest.fixture(scope="session")
diff --git a/tests/unit/auth/fixtures/oauth2_client_fixtures.py b/tests/unit/auth/fixtures/oauth2_client_fixtures.py
index 70cd2c2..263fc94 100644
--- a/tests/unit/auth/fixtures/oauth2_client_fixtures.py
+++ b/tests/unit/auth/fixtures/oauth2_client_fixtures.py
@@ -5,7 +5,7 @@ import datetime
import pytest
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
from gn_auth.auth.authentication.users import hash_password
from gn_auth.auth.authentication.oauth2.models.oauth2client import OAuth2Client
diff --git a/tests/unit/auth/fixtures/resource_fixtures.py b/tests/unit/auth/fixtures/resource_fixtures.py
index efe617e..af22733 100644
--- a/tests/unit/auth/fixtures/resource_fixtures.py
+++ b/tests/unit/auth/fixtures/resource_fixtures.py
@@ -1,7 +1,7 @@
"""Fixtures and utilities for resource-related tests"""
import pytest
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
from .group_fixtures import TEST_RESOURCES
diff --git a/tests/unit/auth/fixtures/role_fixtures.py b/tests/unit/auth/fixtures/role_fixtures.py
index c97716f..ddcbba5 100644
--- a/tests/unit/auth/fixtures/role_fixtures.py
+++ b/tests/unit/auth/fixtures/role_fixtures.py
@@ -3,7 +3,7 @@ import uuid
import pytest
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
from gn_auth.auth.authorisation.roles import Role
from gn_auth.auth.authorisation.privileges import Privilege
diff --git a/tests/unit/auth/fixtures/user_fixtures.py b/tests/unit/auth/fixtures/user_fixtures.py
index 21708a5..531a321 100644
--- a/tests/unit/auth/fixtures/user_fixtures.py
+++ b/tests/unit/auth/fixtures/user_fixtures.py
@@ -3,7 +3,7 @@ import uuid
import pytest
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
from gn_auth.auth.authentication.users import User, hash_password
TEST_USERS = (
diff --git a/tests/unit/auth/test_credentials.py b/tests/unit/auth/test_credentials.py
index 8011ec2..1953228 100644
--- a/tests/unit/auth/test_credentials.py
+++ b/tests/unit/auth/test_credentials.py
@@ -3,7 +3,7 @@ import pytest
from yoyo.migrations import MigrationList
from hypothesis import given, settings, strategies, HealthCheck
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
from gn_auth.auth.authentication import credentials_in_database
from gn_auth.migrations import get_migration, apply_migrations, rollback_migrations
diff --git a/tests/unit/auth/test_groups.py b/tests/unit/auth/test_groups.py
index 8a47cf8..af33f85 100644
--- a/tests/unit/auth/test_groups.py
+++ b/tests/unit/auth/test_groups.py
@@ -4,7 +4,7 @@ from uuid import UUID
import pytest
from pymonad.maybe import Nothing
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
from gn_auth.auth.authentication.users import User
from gn_auth.auth.authorisation.roles import Role
from gn_auth.auth.authorisation.privileges import Privilege
diff --git a/tests/unit/auth/test_migrations_add_data_to_table.py b/tests/unit/auth/test_migrations_add_data_to_table.py
index fa46cc9..b686f25 100644
--- a/tests/unit/auth/test_migrations_add_data_to_table.py
+++ b/tests/unit/auth/test_migrations_add_data_to_table.py
@@ -1,7 +1,7 @@
"""Test data insertion when migrations are run."""
import pytest
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
from gn_auth.migrations import get_migration, apply_migrations, rollback_migrations
from tests.unit.auth.conftest import (
apply_single_migration, rollback_single_migration, migrations_up_to)
diff --git a/tests/unit/auth/test_migrations_add_remove_columns.py b/tests/unit/auth/test_migrations_add_remove_columns.py
index a44563a..af85652 100644
--- a/tests/unit/auth/test_migrations_add_remove_columns.py
+++ b/tests/unit/auth/test_migrations_add_remove_columns.py
@@ -1,7 +1,7 @@
"""Test migrations that alter tables adding/removing columns."""
import pytest
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
from gn_auth.migrations import get_migration, apply_migrations, rollback_migrations
from tests.unit.auth.conftest import (
apply_single_migration, rollback_single_migration, migrations_up_to)
diff --git a/tests/unit/auth/test_migrations_create_tables.py b/tests/unit/auth/test_migrations_create_tables.py
index f56489a..bd0164e 100644
--- a/tests/unit/auth/test_migrations_create_tables.py
+++ b/tests/unit/auth/test_migrations_create_tables.py
@@ -1,7 +1,7 @@
"""Test migrations that create tables"""
import pytest
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
from gn_auth.migrations import get_migration, apply_migrations, rollback_migrations
from tests.unit.auth.conftest import (
apply_single_migration, rollback_single_migration, migrations_up_to)
diff --git a/tests/unit/auth/test_migrations_drop_tables.py b/tests/unit/auth/test_migrations_drop_tables.py
index 4ce0d45..6fa6f2f 100644
--- a/tests/unit/auth/test_migrations_drop_tables.py
+++ b/tests/unit/auth/test_migrations_drop_tables.py
@@ -2,7 +2,7 @@
import pytest
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
from gn_auth.migrations import get_migration, apply_migrations, rollback_migrations
from tests.unit.auth.conftest import (
apply_single_migration, rollback_single_migration, migrations_up_to)
diff --git a/tests/unit/auth/test_migrations_indexes.py b/tests/unit/auth/test_migrations_indexes.py
index dcec7c4..1c543c4 100644
--- a/tests/unit/auth/test_migrations_indexes.py
+++ b/tests/unit/auth/test_migrations_indexes.py
@@ -1,7 +1,7 @@
"""Test that indexes are created and removed."""
import pytest
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
from gn_auth.migrations import get_migration, apply_migrations, rollback_migrations
from tests.unit.auth.conftest import (
apply_single_migration, rollback_single_migration, migrations_up_to)
diff --git a/tests/unit/auth/test_migrations_init_data_in_resource_categories_table.py b/tests/unit/auth/test_migrations_init_data_in_resource_categories_table.py
index 8a92ae1..c34a549 100644
--- a/tests/unit/auth/test_migrations_init_data_in_resource_categories_table.py
+++ b/tests/unit/auth/test_migrations_init_data_in_resource_categories_table.py
@@ -3,7 +3,7 @@ Test that the `resource_categories` table is initialised with the startup data.
"""
import pytest
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
from gn_auth.migrations import get_migration, apply_migrations, rollback_migrations
from tests.unit.auth.conftest import (
apply_single_migration, rollback_single_migration, migrations_up_to)
diff --git a/tests/unit/auth/test_privileges.py b/tests/unit/auth/test_privileges.py
index a40e875..b37a1a7 100644
--- a/tests/unit/auth/test_privileges.py
+++ b/tests/unit/auth/test_privileges.py
@@ -1,7 +1,7 @@
"""Test the privileges module"""
import pytest
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
from gn_auth.auth.authorisation.privileges import Privilege, user_privileges
from tests.unit.auth import conftest
diff --git a/tests/unit/auth/test_resources.py b/tests/unit/auth/test_resources.py
index 12b8d95..9d2671c 100644
--- a/tests/unit/auth/test_resources.py
+++ b/tests/unit/auth/test_resources.py
@@ -3,7 +3,7 @@ import uuid
import pytest
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
from gn_auth.auth.authorisation.groups import Group
from gn_auth.auth.authorisation.errors import AuthorisationError
diff --git a/tests/unit/auth/test_roles.py b/tests/unit/auth/test_roles.py
index 31d5e8e..67654d8 100644
--- a/tests/unit/auth/test_roles.py
+++ b/tests/unit/auth/test_roles.py
@@ -3,7 +3,7 @@ import uuid
import pytest
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
from gn_auth.auth.authorisation.privileges import Privilege
from gn_auth.auth.authorisation.errors import AuthorisationError
from gn_auth.auth.authorisation.roles.models import Role, user_roles, create_role
diff --git a/tests/unit/auth/test_token.py b/tests/unit/auth/test_token.py
index 4a864fe..f66954f 100644
--- a/tests/unit/auth/test_token.py
+++ b/tests/unit/auth/test_token.py
@@ -2,7 +2,7 @@
import pytest
-from gn_auth.auth import db
+from gn_auth.auth.db import sqlite3 as db
SUCCESS_RESULT = {
"status_code": 200,