Example #1
0
def test_add_editor():
    ac = Application()
    m = Mocker()
    ed = m.mock(Editor)
    assert not ac.editors
    with m:
        ac.add_editor(ed)
    assert ed in ac.editors
Example #2
0
def test_add_editor():
    ac = Application()
    m = Mocker()
    ed = m.mock(Editor)
    assert not ac.editors
    with m:
        ac.add_editor(ed)
    assert ed in ac.editors
Example #3
0
 def test(c):
     m = Mocker()
     app = Application()
     ctype = 0
     item = m.mock(TextDocument if c.item_type == "d" else Project)
     for e in range(c.eds):
         ed = m.mock(Editor)
         ed.item_changed(item, ctype)
         app.add_editor(ed)
     with m:
         app.item_changed(item, ctype)
Example #4
0
 def test(c):
     m = Mocker()
     app = Application()
     ctype = 0
     item = m.mock(TextDocument if c.item_type == "d" else Project)
     for e in range(c.eds):
         ed = m.mock(Editor)
         ed.item_changed(item, ctype)
         app.add_editor(ed)
     with m:
         app.item_changed(item, ctype)