예제 #1
0
def test_session_completion(qtmodeltester, session_manager_stub):
    session_manager_stub.sessions = ['default', '1', '2']
    model = miscmodels.SessionCompletionModel()
    qtmodeltester.data_display_may_return_none = True
    qtmodeltester.check(model)

    _check_completions(model, {
        "Sessions": [('default', '', ''), ('1', '', ''), ('2', '', '')]
    })
예제 #2
0
def init_session_completion():
    """Initialize session completion model."""
    log.completion.debug("Initializing session completion.")
    try:
        _instances[usertypes.Completion.sessions].deleteLater()
    except KeyError:
        pass
    model = miscmodels.SessionCompletionModel()
    _instances[usertypes.Completion.sessions] = model
예제 #3
0
def test_session_completion(session_manager_stub):
    session_manager_stub.sessions = ['default', '1', '2']
    actual = _get_completions(miscmodels.SessionCompletionModel())
    assert actual == [("Sessions", [('default', '', ''), ('1', '', ''),
                                    ('2', '', '')])]