Skip to content

Commit 81d1c45

Browse files
committed
code formatting
Signed-off-by: phernandez <paul@basicmachines.co>
1 parent 908d85f commit 81d1c45

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

src/basic_memory/api/app.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
from basic_memory.sync import SyncService, WatchService
1515

1616

17-
async def run_background_sync(sync_service: SyncService, watch_service: WatchService): # pragma: no cover
17+
async def run_background_sync(
18+
sync_service: SyncService, watch_service: WatchService
19+
): # pragma: no cover
1820
logger.info(f"Starting watch service to sync file changes in dir: {project_config.home}")
1921
# full sync
2022
await sync_service.sync(project_config.home, show_progress=False)
@@ -31,7 +33,9 @@ async def lifespan(app: FastAPI): # pragma: no cover
3133
# app config
3234
basic_memory_config = config_manager.load_config()
3335
logger.info(f"Sync changes enabled: {basic_memory_config.sync_changes}")
34-
logger.info(f"Update permalinks on move enabled: {basic_memory_config.update_permalinks_on_move}")
36+
logger.info(
37+
f"Update permalinks on move enabled: {basic_memory_config.update_permalinks_on_move}"
38+
)
3539

3640
watch_task = None
3741
if basic_memory_config.sync_changes:
@@ -48,7 +52,6 @@ async def lifespan(app: FastAPI): # pragma: no cover
4852
else:
4953
logger.info("Sync changes disabled. Skipping watch service.")
5054

51-
5255
# proceed with startup
5356
yield
5457

tests/cli/test_cli_tools.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
33
These tests use real MCP tools with the test environment instead of mocks.
44
"""
5+
56
# Import the ensure_migrations function from main.py for testing
6-
import asyncio
77
from basic_memory.cli.main import ensure_migrations
88

99
import io
@@ -418,31 +418,35 @@ def test_continue_conversation_no_results(cli_env):
418418
@patch("basic_memory.cli.main.db_run_migrations")
419419
def test_ensure_migrations_runs_migrations(mock_run_migrations, test_config, monkeypatch):
420420
"""Test that ensure_migrations runs migrations."""
421+
421422
# Configure mock
422423
async def mock_async_success(*args, **kwargs):
423424
return True
424-
425+
425426
mock_run_migrations.return_value = mock_async_success()
426-
427+
427428
# Call the function
428429
ensure_migrations()
429-
430+
430431
# Check that run_migrations was called
431432
mock_run_migrations.assert_called_once()
432433

433434

434435
@patch("basic_memory.cli.main.db_run_migrations")
435436
@patch("basic_memory.cli.main.logger")
436-
def test_ensure_migrations_handles_errors(mock_logger, mock_run_migrations, test_config, monkeypatch):
437+
def test_ensure_migrations_handles_errors(
438+
mock_logger, mock_run_migrations, test_config, monkeypatch
439+
):
437440
"""Test that ensure_migrations handles errors gracefully."""
441+
438442
# Configure mock to raise an exception when awaited
439443
async def mock_async_error(*args, **kwargs):
440444
raise Exception("Test error")
441-
445+
442446
mock_run_migrations.side_effect = mock_async_error
443-
447+
444448
# Call the function
445449
ensure_migrations()
446-
450+
447451
# Check that error was logged
448452
mock_logger.error.assert_called_once()

0 commit comments

Comments
 (0)