示例#1
0
def test_ProxyToVim_showFeedback_empty():
    from vimpdb.proxy import ProxyToVim
    from vimpdb.proxy import Communicator

    communicator = Mock(spec=Communicator)

    to_vim = ProxyToVim(communicator)
    to_vim.showFeedback('')

    assert not communicator.called
示例#2
0
def test_ProxyToVim_showFeedback_empty():
    from vimpdb.proxy import ProxyToVim
    from vimpdb.proxy import Communicator

    communicator = Mock(spec=Communicator)

    to_vim = ProxyToVim(communicator)
    to_vim.showFeedback('')

    assert not communicator.called
示例#3
0
def test_ProxyToVim_showFeedback_content():
    from vimpdb.proxy import ProxyToVim
    from vimpdb.proxy import Communicator

    communicator = Mock(spec=Communicator)
    communicator._remote_expr.return_value = '1'

    to_vim = ProxyToVim(communicator)
    to_vim.showFeedback('first\nsecond')

    assert communicator._remote_expr.call_count == 1
    communicator._remote_expr.assert_called_with("exists('*PDB_setup_egg')")
    assert communicator._send.call_count == 1
    communicator._send.assert_called_with(
        ":call PDB_show_feedback(['first', 'second'])<CR>")
示例#4
0
def test_ProxyToVim_showFeedback_content():
    from vimpdb.proxy import ProxyToVim
    from vimpdb.proxy import Communicator

    communicator = Mock(spec=Communicator)
    communicator._remote_expr.return_value = '1'

    to_vim = ProxyToVim(communicator)
    to_vim.showFeedback('first\nsecond')

    assert communicator._remote_expr.call_count == 1
    communicator._remote_expr.assert_called_with("exists('*PDB_setup_egg')")
    assert communicator._send.call_count == 1
    communicator._send.assert_called_with(
        ":call PDB_show_feedback(['first', 'second'])<CR>")