Beispiel #1
0
 def test(config):
     found = []
     proj = Project(None)
     proj.editors = docs = []
     m = Mocker()
     doc = m.mock(TextDocument)
     for item in config:
         editor = m.mock(Editor)
         docs.append(editor)
         editor.name >> item
         adoc = m.mock(TextDocument)
         editor.document >> (doc if item is DOC else adoc)
         if item is DOC:
             found.append(editor)
     with m:
         eq_(config, [editor.name for editor in docs])
         result = list(proj.iter_editors_of_document(doc))
         eq_(result, found)