summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2017-06-30 19:46:41 -0400
committerGitHub <noreply@github.com>2017-06-30 19:46:41 -0400
commited54110d6fa27833467f55051c47c0cea77fabee (patch)
tree8155522800d1cbd320325abcbafb4cd9a02eec3b /tests/test_cmd2.py
parent309c3eceb46a841fec43bdd72d304288e0241656 (diff)
parent613a1b7d9868c658b8269dcc0db66f43c05311be (diff)
downloadcmd2-git-ed54110d6fa27833467f55051c47c0cea77fabee.tar.gz
Merge pull request #155 from python-cmd2/pyperclip
Added 3rd-party dependency on pyperclip for clipboard copy/paste functionality
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index db7f8cf7..d288f78f 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -472,23 +472,20 @@ def test_pipe_to_shell(base_app):
assert out[0].strip() == expected[0].strip()
+@pytest.mark.skipif(not cmd2.can_clip,
+ reason="Pyperclip could not find a copy/paste mechanism for your system")
def test_send_to_paste_buffer(base_app):
from cmd2 import can_clip
# Test writing to the PasteBuffer/Clipboard
run_cmd(base_app, 'help >')
expected = normalize(BASE_HELP)
-
- # If the tools for interacting with the clipboard/pastebuffer are available
- if cmd2.can_clip:
- # Read from the clipboard
- assert normalize(cmd2.get_paste_buffer()) == expected
+ assert normalize(cmd2.get_paste_buffer()) == expected
# Test appending to the PasteBuffer/Clipboard
run_cmd(base_app, 'help history >>')
expected = normalize(BASE_HELP + '\n' + HELP_HISTORY)
- if cmd2.can_clip:
- assert normalize(cmd2.get_paste_buffer()) == expected
+ assert normalize(cmd2.get_paste_buffer()) == expected
def test_base_timing(base_app, capsys):