コード例 #1
0
ファイル: test_wraplines.py プロジェクト: khairy/editxt
def test_WrapLinesController_wrap_():
    m = Mocker()
    cmd = m.replace(mod, 'wrap_selected_lines')
    tv = m.mock(TextView)
    ctl = WrapLinesController(tv)
    cmd(tv, ctl.options)
    m.method(ctl.save_options)()
    m.method(ctl.cancel_)(None)
    with m:
        ctl.wrap_(None)
コード例 #2
0
ファイル: test_wraplines.py プロジェクト: khairy/editxt
def test_WrapLinesController_wrap_():
    m = Mocker()
    cmd = m.replace(mod, 'wrap_selected_lines')
    tv = m.mock(TextView)
    ctl = WrapLinesController(tv)
    cmd(tv, ctl.options)
    m.method(ctl.save_options)()
    m.method(ctl.cancel_)(None)
    with m:
        ctl.wrap_(None)
コード例 #3
0
ファイル: test_wraplines.py プロジェクト: editxt/editxt
def test_WrapLinesController_wrap_():
    with test_app() as app:
        m = Mocker()
        editor = base.Options(app=app)
        cmd = m.replace(mod, 'wrap_selected_lines')
        ctl = WrapLinesController(editor)
        cmd(editor, ctl.options)
        m.method(ctl.save_options)()
        m.method(ctl.cancel_)(None)
        with m:
            ctl.wrap_(None)
コード例 #4
0
ファイル: test_wraplines.py プロジェクト: khairy/editxt
def test_WrapLinesController_default_options():
    with replace_history() as history:
        ctl = WrapLinesController(None)
        eq_(ctl.options._target,
            mod.Options(
                wrap_column=const.DEFAULT_RIGHT_MARGIN,
                indent=True,
            ))