2.1.0 (#317)
Co-authored-by: Quentin Torroba <quentin.torroba@mistral.ai> Co-authored-by: Michel Thomazo <michel.thomazo@mistral.ai> Co-authored-by: Clément Drouin <clement.drouin@mistral.ai> Co-authored-by: Vincent Guilloux <vincent.guilloux@mistral.ai> Co-authored-by: Clément Siriex <clement.sirieix@mistral.ai> Co-authored-by: Kim-Adeline Miguel <kimadeline.miguel@mistral.ai> Co-authored-by: Nicolas Karolak <nicolas@karolak.fr>
This commit is contained in:
parent
9809cfc831
commit
51fecc67d9
176 changed files with 8652 additions and 4451 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from unittest.mock import MagicMock, patch
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from textual.selection import Selection
|
||||
|
|
@ -8,8 +8,6 @@ from textual.widget import Widget
|
|||
|
||||
from vibe.cli.clipboard import copy_selection_to_clipboard
|
||||
from vibe.cli.textual_ui.app import VibeApp
|
||||
from vibe.core.agent_loop import AgentLoop
|
||||
from vibe.core.config import SessionLoggingConfig, VibeConfig
|
||||
|
||||
|
||||
class ClipboardSelectionWidget(Widget):
|
||||
|
|
@ -27,24 +25,15 @@ class ClipboardSelectionWidget(Widget):
|
|||
|
||||
@pytest.mark.asyncio
|
||||
async def test_ui_clipboard_notification_does_not_crash_on_markup_text(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
monkeypatch: pytest.MonkeyPatch, vibe_app: VibeApp
|
||||
) -> None:
|
||||
agent_loop = AgentLoop(
|
||||
config=VibeConfig(
|
||||
session_logging=SessionLoggingConfig(enabled=False),
|
||||
enable_update_checks=False,
|
||||
)
|
||||
)
|
||||
app = VibeApp(agent_loop=agent_loop)
|
||||
|
||||
async with app.run_test(notifications=True) as pilot:
|
||||
await app.mount(ClipboardSelectionWidget("[/]"))
|
||||
with patch("vibe.cli.clipboard._get_copy_fns") as mock_get_copy_fns:
|
||||
mock_get_copy_fns.return_value = [MagicMock()]
|
||||
copy_selection_to_clipboard(app)
|
||||
async with vibe_app.run_test(notifications=True) as pilot:
|
||||
await vibe_app.mount(ClipboardSelectionWidget("[/]"))
|
||||
with patch("vibe.cli.clipboard._copy_osc52"):
|
||||
copy_selection_to_clipboard(vibe_app)
|
||||
|
||||
await pilot.pause(0.1)
|
||||
notifications = list(app._notifications)
|
||||
notifications = list(vibe_app._notifications)
|
||||
assert notifications
|
||||
notification = notifications[-1]
|
||||
assert notification.markup is False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue