Use textwrap.dedent to parse multiline clipboard text
This commit is contained in:
parent
f08704e789
commit
524341fd7a
@ -25,6 +25,7 @@ import json
|
||||
import os.path
|
||||
import logging
|
||||
import collections
|
||||
import textwrap
|
||||
|
||||
import pytest
|
||||
import yaml
|
||||
@ -209,8 +210,7 @@ def fill_clipboard(qtbot, qapp, httpbin, what, content):
|
||||
r'(?P<what>primary selection|clipboard):\n'
|
||||
r'(?P<content>.+)$', flags=re.DOTALL))
|
||||
def fill_clipboard_multiline(qtbot, qapp, httpbin, what, content):
|
||||
content = '\n'.join(l.strip() for l in content.strip().split('\n'))
|
||||
fill_clipboard(qtbot, qapp, httpbin, what, content)
|
||||
fill_clipboard(qtbot, qapp, httpbin, what, textwrap.dedent(content))
|
||||
|
||||
|
||||
## Then
|
||||
|
Loading…
Reference in New Issue
Block a user