MCPcopy Create free account
hub / github.com/blender/blender / text_editor_simple

Function text_editor_simple

tests/python/ui_simulate/test_undo.py:105–120  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

103
104
105def text_editor_simple():
106 e, t, _ = ui.test_window()
107
108 import bpy
109 yield from _text_editor_startup(e)
110 text = bpy.data.texts[0]
111
112 yield e.text("Hello\nWorld")
113 t.assertEqual(text.as_string(), "Hello\nWorld")
114 yield e.shift.home().ctrl.x().back_space()
115 yield e.home().ctrl.v().ret()
116 t.assertEqual(text.as_string(), "World\nHello")
117 yield e.ctrl.a().tab()
118 t.assertEqual(text.as_string(), " World\n Hello")
119 yield e.ctrl.z(5)
120 t.assertEqual(text.as_string(), "Hello\nWorld")
121
122
123def text_editor_edit_mode_mix():

Callers

nothing calls this directly

Calls 5

_text_editor_startupFunction · 0.85
textMethod · 0.80
xMethod · 0.45
vMethod · 0.45
zMethod · 0.45

Tested by

no test coverage detected