Satisfy project quality gates
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import pytest
|
||||
from pathlib import Path
|
||||
from unittest.mock import AsyncMock, MagicMock
|
||||
|
||||
from sqlalchemy import create_engine
|
||||
@@ -47,14 +46,19 @@ async def test_full_lifecycle(setup):
|
||||
assert project.id == 1
|
||||
|
||||
# Create session
|
||||
create_result = await sess_svc.create_session(project_id=project.id, harness_name="claude-code", nickname="e2e")
|
||||
create_result = await sess_svc.create_session(
|
||||
project_id=project.id, harness_name="claude-code", nickname="e2e"
|
||||
)
|
||||
session = create_result.session
|
||||
assert session.id is not None
|
||||
tmux.spawn.assert_called_once()
|
||||
|
||||
# List sessions - alive
|
||||
from hqt.tmux.runner import WindowInfo
|
||||
tmux.poll_info.return_value = {session.tmux_session_name: WindowInfo(alive=True, last_activity=0)}
|
||||
|
||||
tmux.poll_info.return_value = {
|
||||
session.tmux_session_name: WindowInfo(alive=True, last_activity=0)
|
||||
}
|
||||
infos = await sess_svc.list_sessions(project_id=project.id)
|
||||
assert len(infos) == 1
|
||||
assert infos[0].alive is True
|
||||
@@ -64,7 +68,9 @@ async def test_full_lifecycle(setup):
|
||||
tmux.kill.assert_called_once_with(session.tmux_session_name)
|
||||
|
||||
# List sessions - dead
|
||||
tmux.poll_info.return_value = {session.tmux_session_name: WindowInfo(alive=False, last_activity=0)}
|
||||
tmux.poll_info.return_value = {
|
||||
session.tmux_session_name: WindowInfo(alive=False, last_activity=0)
|
||||
}
|
||||
infos = await sess_svc.list_sessions(project_id=project.id)
|
||||
assert len(infos) == 1
|
||||
assert infos[0].alive is False
|
||||
|
||||
Reference in New Issue
Block a user