Exemple #1
0
def test_SortLinesController_sort_():
    m = Mocker()
    sort = m.replace(mod, 'sortlines')
    tv = m.mock(TextView)
    with replace_history() as history:
        slc = SortLinesController(tv)
        sort(tv, slc.options)
        m.method(slc.save_options)()
        m.method(slc.cancel_)(None)
        with m:
            slc.sort_(None)
Exemple #2
0
def test_SortLinesController_sort_():
    m = Mocker()
    sort = m.replace(mod, 'sortlines')
    with test_app() as app:
        editor = base.Options(app=app)
        slc = SortLinesController(editor)
        sort(editor, slc.options)
        m.method(slc.save_options)()
        m.method(slc.cancel_)(None)
        with m:
            slc.sort_(None)
Exemple #3
0
def test_SortLinesController_sort_():
    m = Mocker()
    sort = m.replace(mod, 'sortlines')
    tv = m.mock(TextView)
    with replace_history() as history:
        slc = SortLinesController(tv)
        sort(tv, slc.options)
        m.method(slc.save_options)()
        m.method(slc.cancel_)(None)
        with m:
            slc.sort_(None)
Exemple #4
0
 def test(hist, opts):
     with replace_history() as history:
         history.append(hist)
         ctl = SortLinesController(None)
         eq_(ctl.options._target, SortOptions(**opts))
Exemple #5
0
def test_SortLinesController_default_options():
    with replace_history() as history:
        ctl = SortLinesController(None)
        for name, value in SortOptions.DEFAULTS.items():
            eq_(getattr(ctl.options, name), value, name)