Ejemplo n.º 1
0
 def test(has_current):
     m = Mocker()
     ac = Application()
     ac.current_editor = m.method(ac.current_editor)
     if has_current:
         ed = m.mock(Editor)
         proj = (ac.current_editor() >> ed).new_project() >> m.mock(Project)
     else:
         ac.current_editor() >> None
         proj = None
     with m:
         result = ac.new_project()
         eq_(result, proj)
Ejemplo n.º 2
0
 def test(has_current):
     m = Mocker()
     ac = Application()
     ac.current_editor = m.method(ac.current_editor)
     if has_current:
         ed = m.mock(Editor)
         proj = (ac.current_editor() >> ed).new_project() >> m.mock(Project)
     else:
         ac.current_editor() >> None
         proj = None
     with m:
         result = ac.new_project()
         eq_(result, proj)
Ejemplo n.º 3
0
 def test(config):
     ac = Application()
     m = Mocker()
     ac.iter_editors = iwc = m.method(ac.iter_editors)
     iwc() >> iter(config)
     with m:
         result = ac.current_editor()
         eq_(result, (config[0] if config else None))
Ejemplo n.º 4
0
 def test(config):
     ac = Application()
     m = Mocker()
     ac.iter_editors = iwc = m.method(ac.iter_editors)
     iwc() >> iter(config)
     with m:
         result = ac.current_editor()
         eq_(result, (config[0] if config else None))