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
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)