v2.17.0 (#822)
Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai> Co-authored-by: Guillaume LE GOFF <guillaume.lgf@gmail.com> Co-authored-by: Hdandria <henri.dandria@mistral.ai> Co-authored-by: Ivana Dunisijevic <ivana.dunisijevic@mistral.ai> Co-authored-by: Jean Burellier <sheplu@users.noreply.github.com> Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai> Co-authored-by: Mert Unsal <mert.unsal@mistral.ai> Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com> Co-authored-by: Paul VEZIA <166131032+le-codeur-rapide@users.noreply.github.com> Co-authored-by: Pierre Rossinès <pierre.rossines@mistral.ai> Co-authored-by: Val <102326092+vdeva@users.noreply.github.com> Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com> Co-authored-by: renovate-mistral[bot] <253709520+renovate-mistral[bot]@users.noreply.github.com> Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
564a14365e
commit
6bedf271ce
223 changed files with 10533 additions and 6947 deletions
|
|
@ -38,6 +38,37 @@ class EditApprovalAnsiApp(EditApprovalApp):
|
|||
_diff_theme = "ansi-dark"
|
||||
|
||||
|
||||
REPLACE_ALL_CONTENT = "\n".join([
|
||||
"def total(items):",
|
||||
" count = 0",
|
||||
" for item in items:",
|
||||
" count = count + 1",
|
||||
" return count",
|
||||
"",
|
||||
"def reset():",
|
||||
" count = 0",
|
||||
" return count",
|
||||
])
|
||||
|
||||
|
||||
class EditReplaceAllApprovalApp(BaseSnapshotTestApp):
|
||||
_diff_theme: str = "tokyo-night"
|
||||
|
||||
async def on_ready(self) -> None:
|
||||
await super().on_ready()
|
||||
self.theme = self._diff_theme
|
||||
path = Path("src/counter.py")
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
path.write_text(REPLACE_ALL_CONTENT)
|
||||
args = EditArgs(
|
||||
file_path="src/counter.py",
|
||||
old_string="count = 0",
|
||||
new_string="count = 1",
|
||||
replace_all=True,
|
||||
)
|
||||
await self._switch_to_approval_app("edit", args)
|
||||
|
||||
|
||||
def test_snapshot_edit_approval_diff(snap_compare: SnapCompare) -> None:
|
||||
async def run_before(pilot: Pilot) -> None:
|
||||
await pilot.pause(0.3)
|
||||
|
|
@ -58,3 +89,14 @@ def test_snapshot_edit_approval_diff_ansi(snap_compare: SnapCompare) -> None:
|
|||
terminal_size=(100, 30),
|
||||
run_before=run_before,
|
||||
)
|
||||
|
||||
|
||||
def test_snapshot_edit_approval_diff_replace_all(snap_compare: SnapCompare) -> None:
|
||||
async def run_before(pilot: Pilot) -> None:
|
||||
await pilot.pause(0.3)
|
||||
|
||||
assert snap_compare(
|
||||
"test_ui_snapshot_edit_diff.py:EditReplaceAllApprovalApp",
|
||||
terminal_size=(100, 30),
|
||||
run_before=run_before,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue