Standardize IDs, fix group APIs, fix tests
This commit is contained in:
@ -6,12 +6,13 @@ This is technically an integration test, as it requires the other subsystems to
|
||||
run, but it uses the internal API rather than the exposed routes.
|
||||
"""
|
||||
|
||||
import json
|
||||
|
||||
import allure
|
||||
import pytest
|
||||
import pytest_asyncio
|
||||
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from sshecret_admin.core.settings import AdminServerSettings
|
||||
from sshecret_admin.services.models import SecretGroup
|
||||
@ -21,13 +22,9 @@ from sshecret_admin.services.secret_manager import (
|
||||
InvalidSecretNameError,
|
||||
InvalidGroupNameError,
|
||||
)
|
||||
from sshecret_admin.auth.models import Base, PasswordDB
|
||||
from sshecret_admin.services.master_password import setup_master_password
|
||||
from sshecret_admin.auth.models import Base
|
||||
|
||||
# -------- global parameter sets start here -------- #
|
||||
|
||||
|
||||
# -------- Fixtures start here -------- #
|
||||
from sshecret_admin.services.secret_manager import setup_private_key
|
||||
|
||||
|
||||
@pytest_asyncio.fixture(autouse=True)
|
||||
@ -35,14 +32,7 @@ async def create_admin_db(admin_server_settings: AdminServerSettings) -> None:
|
||||
"""Create the database."""
|
||||
engine = create_engine(admin_server_settings.admin_db)
|
||||
Base.metadata.create_all(engine)
|
||||
encr_master_password = setup_master_password(
|
||||
settings=admin_server_settings, regenerate=True
|
||||
)
|
||||
|
||||
with Session(engine) as session:
|
||||
pwdb = PasswordDB(id=1, encrypted_password=encr_master_password)
|
||||
session.add(pwdb)
|
||||
session.commit()
|
||||
setup_private_key(settings=admin_server_settings, regenerate=True)
|
||||
|
||||
|
||||
@pytest_asyncio.fixture()
|
||||
|
||||
Reference in New Issue
Block a user