tests: Add plain arg to quteprocess.get_contents.
This commit is contained in:
parent
35de87f973
commit
b7323914b8
@ -263,11 +263,16 @@ class QuteProc(testprocess.Process):
|
|||||||
print(data)
|
print(data)
|
||||||
return yaml.load(data)
|
return yaml.load(data)
|
||||||
|
|
||||||
def get_content(self):
|
def get_content(self, plain=True):
|
||||||
"""Get the contents of the current page."""
|
"""Get the contents of the current page."""
|
||||||
with tempfile.TemporaryDirectory() as tmpdir:
|
with tempfile.TemporaryDirectory() as tmpdir:
|
||||||
path = os.path.join(tmpdir, 'page')
|
path = os.path.join(tmpdir, 'page')
|
||||||
|
|
||||||
|
if plain:
|
||||||
self.send_cmd(':debug-dump-page --plain "{}"'.format(path))
|
self.send_cmd(':debug-dump-page --plain "{}"'.format(path))
|
||||||
|
else:
|
||||||
|
self.send_cmd(':debug-dump-page "{}"'.format(path))
|
||||||
|
|
||||||
self.wait_for(category='message', loglevel=logging.INFO,
|
self.wait_for(category='message', loglevel=logging.INFO,
|
||||||
message='Dumped page to {}.'.format(path))
|
message='Dumped page to {}.'.format(path))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user