Exemplo n.º 1
0
def test_clipboard_on_osx_ensure_commands(mocker):
    mocker.patch('passpie.clipboard.process.call')
    mock_ensure_commands = mocker.patch('passpie.clipboard.ensure_commands')
    commands = clipboard.OSX_COMMANDS

    clipboard._copy_osx('text')

    mock_ensure_commands.assert_called_once_with(commands)
Exemplo n.º 2
0
def test_clipboard_on_osx_ensure_commands(mocker):
    mocker.patch('passpie.clipboard.Popen')
    mock_ensure_commands = mocker.patch('passpie.clipboard.ensure_commands')
    commands = clipboard.OSX_COMMANDS

    clipboard._copy_osx('text')

    mock_ensure_commands.assert_called_once_with(commands)
Exemplo n.º 3
0
def test_clear_is_called_when_clear_is_passed_to_copy_osx(mocker):
    mocker.patch('passpie.clipboard.ensure_commands', return_value='command')
    mocker.patch('passpie.clipboard.process')
    mock_clean = mocker.patch('passpie.clipboard.clean')

    clipboard._copy_osx('text', clear=5)
    assert mock_clean.called
    mock_clean.assert_called_once_with('command', delay=5)