From 17c8e9e08e1c92c81ea48aae0d764bc08bd76cb3 Mon Sep 17 00:00:00 2001 From: John Helmert Date: Sat, 3 Aug 2019 16:58:31 -0500 Subject: [PATCH] Fix typo in clipboard.py causing copy bug Fixes #5 --- tests/test_clipboard.py | 3 +-- tuir/clipboard.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_clipboard.py b/tests/test_clipboard.py index a514f97..74da971 100644 --- a/tests/test_clipboard.py +++ b/tests/test_clipboard.py @@ -23,7 +23,6 @@ def test_copy_nix(): # Mock out the subprocess calls p = mock.Mock() p.communicate = mock.Mock() - Popen.return_value = p copy('test', 'xsel -b -i') @@ -31,7 +30,7 @@ def test_copy_nix(): p.communicate.assert_called_with(input='test'.encode('utf-8')) 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')) def test_copy_darwin(): diff --git a/tuir/clipboard.py b/tuir/clipboard.py index ed43cc5..c377c90 100644 --- a/tuir/clipboard.py +++ b/tuir/clipboard.py @@ -20,6 +20,6 @@ def copy(text, cmd=None): if sys.platform == 'darwin': cmd = 'pbcopy w' else: # For Linux, BSD, cygwin, etc. - cmd = 'xclip -selection -clipboard' + cmd = 'xclip -selection clipboard' _subprocess_copy(text, cmd.split())