smt
This commit is contained in:
1 parent
2ad5d1711c
commit
696322dde2
3 files changed
+143
-4
No files matched your search
+21
-1
@@ -11,7 +11,7 @@ from rich.markdown import Markdown
|
||||
|
||||
import httpx
|
||||
|
||||
from ai_chat import AIChatApp, AIConfig, MessageBubble, ChatMessage, ControlsHelp, main
|
||||
from ai_chat import AIChatApp, AIConfig, MessageBubble, ChatMessage, ControlsHelp, ScreenshotOptions, main
|
||||
|
||||
|
||||
class ChatTests(unittest.IsolatedAsyncioTestCase):
|
||||
@@ -194,6 +194,26 @@ class ChatTests(unittest.IsolatedAsyncioTestCase):
|
||||
self.assertFalse(bubble._waiting_widget.display)
|
||||
self.assertEqual(app.messages[-1].role, 'system')
|
||||
|
||||
async def test_screenshot_menu_stays_open_when_turn_finishes(self):
|
||||
app = await self.make_app(lambda request: httpx.Response(500))
|
||||
finish = asyncio.Event()
|
||||
async def stream(ai, history):
|
||||
await finish.wait()
|
||||
yield "Complete"
|
||||
app.stream_ai = stream
|
||||
async with app.run_test() as pilot:
|
||||
await pilot.press('s')
|
||||
self.assertIsInstance(app.screen, ScreenshotOptions)
|
||||
self.assertGreater(app.screen.query_one('#full').region.height, 0)
|
||||
finish.set()
|
||||
await self.wait_finished(app, pilot)
|
||||
self.assertEqual(app.current_turn, 1)
|
||||
self.assertEqual(app.turn_counter.content, 'Turns completed: 1 / 1')
|
||||
self.assertIsInstance(app.screen, ScreenshotOptions)
|
||||
await pilot.press('escape', 'f2')
|
||||
self.assertIsInstance(app.screen, ScreenshotOptions)
|
||||
await pilot.press('escape')
|
||||
|
||||
|
||||
class CommandLineTests(unittest.TestCase):
|
||||
def test_invalid_environment_turns_reports_usage_error(self):
|
||||
|
||||
Reference in new issue
Block a user