Exemplo n.º 1
0
def test_newWindow_():
    dc = DocumentController.sharedDocumentController()
    m = Mocker()
    app = m.replace("editxt.app", type=Application)
    app.create_editor()
    with m:
        dc.newWindow_(None)
Exemplo n.º 2
0
 def test(action, app_method):
     dc = DocumentController.sharedDocumentController()
     m = Mocker()
     app = m.replace(editxt, 'app')
     getattr(app, app_method)()
     with m:
         getattr(dc, action)(None)
Exemplo n.º 3
0
def test_openErrorLog_():
    dc = DocumentController.sharedDocumentController()
    m = Mocker()
    app = m.replace("editxt.app", type=Application)
    app.open_error_log()
    with m:
        dc.openErrorLog_(None)
Exemplo n.º 4
0
 def test(action, app_method):
     dc = DocumentController.sharedDocumentController()
     m = Mocker()
     app = m.replace(editxt, 'app')
     getattr(app, app_method)()
     with m:
         getattr(dc, action)(None)
Exemplo n.º 5
0
def test_openPath_():
    dc = DocumentController.sharedDocumentController()
    m = Mocker()
    app = m.replace("editxt.app", type=Application)
    app.open_path_dialog()
    with m:
        dc.openPath_(None)
Exemplo n.º 6
0
def test_applicationWillFinishLaunching_():
    dc = DocumentController.sharedDocumentController()
    m = Mocker()
    app = m.replace(editxt, 'app')
    nsapp = m.mock(ak.NSApplication)
    app.application_will_finish_launching(nsapp, dc)
    with m:
        dc.applicationWillFinishLaunching_(nsapp)
Exemplo n.º 7
0
def test_applicationWillFinishLaunching_():
    dc = DocumentController.sharedDocumentController()
    m = Mocker()
    app = m.replace(editxt, 'app')
    nsapp = m.mock(ak.NSApplication)
    app.application_will_finish_launching(nsapp, dc)
    with m:
        dc.applicationWillFinishLaunching_(nsapp)
Exemplo n.º 8
0
            def dc_test(when):
                from editxt.application import DocumentController
                dc = DocumentController.sharedDocumentController()

                global skipdebug
                if not skipdebug:
                    import pdb; pdb.set_trace()

                assert isinstance(dc, DocumentController), \
                    "shared document controller has wrong type %s %s.%s" \
                    % (when, mod.__name__, test.__name__)
                assert not dc.documents(), "(%s) %s.%s : %r" % \
                    (when, mod.__name__, test.__name__, dc.documents())
Exemplo n.º 9
0
            def dc_test(when):
                from editxt.application import DocumentController
                dc = DocumentController.sharedDocumentController()

                global skipdebug
                if not skipdebug:
                    import pdb
                    pdb.set_trace()

                assert isinstance(dc, DocumentController), \
                    "shared document controller has wrong type %s %s.%s" \
                    % (when, mod.__name__, test.__name__)
                assert not dc.documents(), "(%s) %s.%s : %r" % \
                    (when, mod.__name__, test.__name__, dc.documents())
Exemplo n.º 10
0
 def check_app_state():
     from editxt.application import DocumentController
     dc = DocumentController.sharedDocumentController()
     assert not dc.documents(), "app state was dirty %s %s: %r" \
         % (when, test.__name__, dc.documents())
Exemplo n.º 11
0
 def check_app_state():
     from editxt.application import DocumentController
     dc = DocumentController.sharedDocumentController()
     assert not dc.documents(), "app state was dirty %s %s: %r" \
         % (when, test.__name__, dc.documents())
Exemplo n.º 12
0
def test_get_document_controller():
    dc = DocumentController.sharedDocumentController()
    assert isinstance(dc, DocumentController)
Exemplo n.º 13
0
def test_applicationShouldOpenUntitledFile_():
    dc = DocumentController.sharedDocumentController()
    assert not dc.applicationShouldOpenUntitledFile_(None)
Exemplo n.º 14
0
def test_editxt_app():
    import editxt
    dc = DocumentController.sharedDocumentController()
    assert editxt.app is dc.controller
Exemplo n.º 15
0
def test_saveProjectAs_():
    dc = DocumentController.sharedDocumentController()
    dc.saveProjectAs_ #(None) # TODO implement this method
Exemplo n.º 16
0
def test_closeCurrentProject_():
    dc = DocumentController.sharedDocumentController()
    dc.closeCurrentProject_ #(None) # TODO implement this method
Exemplo n.º 17
0
def test_applicationShouldOpenUntitledFile_():
    dc = DocumentController.sharedDocumentController()
    assert not dc.applicationShouldOpenUntitledFile_(None)
Exemplo n.º 18
0
def test_get_document_controller():
    dc = DocumentController.sharedDocumentController()
    assert isinstance(dc, DocumentController)
Exemplo n.º 19
0
def test_newProject_():
    dc = DocumentController.sharedDocumentController()
    dc.newProject_ #(None) # TODO implement this method
Exemplo n.º 20
0
def test_editxt_app():
    import editxt
    dc = DocumentController.sharedDocumentController()
    assert editxt.app is dc.controller