@@ -23,7 +23,6 @@ def test_copy_nix():
|
|||||||
# Mock out the subprocess calls
|
# Mock out the subprocess calls
|
||||||
p = mock.Mock()
|
p = mock.Mock()
|
||||||
p.communicate = mock.Mock()
|
p.communicate = mock.Mock()
|
||||||
|
|
||||||
Popen.return_value = p
|
Popen.return_value = p
|
||||||
|
|
||||||
copy('test', 'xsel -b -i')
|
copy('test', 'xsel -b -i')
|
||||||
@@ -31,7 +30,7 @@ def test_copy_nix():
|
|||||||
p.communicate.assert_called_with(input='test'.encode('utf-8'))
|
p.communicate.assert_called_with(input='test'.encode('utf-8'))
|
||||||
|
|
||||||
copy('test ❤')
|
copy('test ❤')
|
||||||
assert Popen.call_args[0][0] == ['xclip', '-selection', '-clipboard']
|
assert Popen.call_args[0][0] == ['xclip', '-selection', 'clipboard']
|
||||||
p.communicate.assert_called_with(input='test ❤'.encode('utf-8'))
|
p.communicate.assert_called_with(input='test ❤'.encode('utf-8'))
|
||||||
|
|
||||||
def test_copy_darwin():
|
def test_copy_darwin():
|
||||||
|
|||||||
@@ -20,6 +20,6 @@ def copy(text, cmd=None):
|
|||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
cmd = 'pbcopy w'
|
cmd = 'pbcopy w'
|
||||||
else: # For Linux, BSD, cygwin, etc.
|
else: # For Linux, BSD, cygwin, etc.
|
||||||
cmd = 'xclip -selection -clipboard'
|
cmd = 'xclip -selection clipboard'
|
||||||
|
|
||||||
_subprocess_copy(text, cmd.split())
|
_subprocess_copy(text, cmd.split())
|
||||||
|
|||||||
Reference in New Issue
Block a user