refactor: update imports fabledscryer → roundtable
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -2,7 +2,7 @@ import pytest
|
||||
import pytest_asyncio
|
||||
from pathlib import Path
|
||||
import textwrap
|
||||
from fabledscryer.app import create_app
|
||||
from roundtable.app import create_app
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import pytest
|
||||
from fabledscryer.app import create_app
|
||||
from roundtable.app import create_app
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
+6
-6
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
import bcrypt
|
||||
from unittest.mock import AsyncMock, patch
|
||||
from fabledscryer.models.users import User, UserRole
|
||||
from roundtable.models.users import User, UserRole
|
||||
|
||||
|
||||
def make_user(role=UserRole.admin):
|
||||
@@ -23,7 +23,7 @@ async def test_login_page_returns_200(client):
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_login_redirects_to_setup_when_no_users(client, app):
|
||||
with patch("fabledscryer.auth.routes.get_user_count", new=AsyncMock(return_value=0)):
|
||||
with patch("roundtable.auth.routes.get_user_count", new=AsyncMock(return_value=0)):
|
||||
response = await client.get("/login")
|
||||
assert response.status_code == 302
|
||||
assert "/setup" in response.headers["Location"]
|
||||
@@ -32,8 +32,8 @@ async def test_login_redirects_to_setup_when_no_users(client, app):
|
||||
@pytest.mark.asyncio
|
||||
async def test_login_success_redirects_to_dashboard(client, app):
|
||||
user = make_user()
|
||||
with patch("fabledscryer.auth.routes.get_user_count", new=AsyncMock(return_value=1)), \
|
||||
patch("fabledscryer.auth.routes.get_user_by_username", new=AsyncMock(return_value=user)):
|
||||
with patch("roundtable.auth.routes.get_user_count", new=AsyncMock(return_value=1)), \
|
||||
patch("roundtable.auth.routes.get_user_by_username", new=AsyncMock(return_value=user)):
|
||||
response = await client.post("/login", form={"username": "admin", "password": "password"})
|
||||
assert response.status_code == 302
|
||||
assert "/" in response.headers["Location"]
|
||||
@@ -42,8 +42,8 @@ async def test_login_success_redirects_to_dashboard(client, app):
|
||||
@pytest.mark.asyncio
|
||||
async def test_login_failure_returns_400(client, app):
|
||||
user = make_user()
|
||||
with patch("fabledscryer.auth.routes.get_user_count", new=AsyncMock(return_value=1)), \
|
||||
patch("fabledscryer.auth.routes.get_user_by_username", new=AsyncMock(return_value=user)):
|
||||
with patch("roundtable.auth.routes.get_user_count", new=AsyncMock(return_value=1)), \
|
||||
patch("roundtable.auth.routes.get_user_by_username", new=AsyncMock(return_value=user)):
|
||||
response = await client.post("/login", form={"username": "admin", "password": "wrong"})
|
||||
assert response.status_code == 400
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import os
|
||||
import textwrap
|
||||
import pytest
|
||||
from fabledscryer.config import load_bootstrap
|
||||
from roundtable.config import load_bootstrap
|
||||
|
||||
|
||||
def test_load_bootstrap_from_yaml(tmp_path):
|
||||
cfg_file = tmp_path / "config.yaml"
|
||||
cfg_file.write_text(textwrap.dedent("""\
|
||||
database:
|
||||
url: postgresql+asyncpg://user:pass@localhost/fabledscryer
|
||||
url: postgresql+asyncpg://user:pass@localhost/roundtable
|
||||
secret_key: test-secret
|
||||
"""))
|
||||
cfg = load_bootstrap(cfg_file)
|
||||
assert cfg["database_url"] == "postgresql+asyncpg://user:pass@localhost/fabledscryer"
|
||||
assert cfg["database_url"] == "postgresql+asyncpg://user:pass@localhost/roundtable"
|
||||
assert cfg["secret_key"] == "test-secret"
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import pytest
|
||||
from fabledscryer.models.users import User, UserRole
|
||||
from roundtable.models.users import User, UserRole
|
||||
|
||||
|
||||
def test_user_model_fields():
|
||||
|
||||
Reference in New Issue
Block a user