tests: Add plain arg to quteprocess.get_contents.

This commit is contained in:
Florian Bruhin 2015-11-24 18:22:20 +01:00
parent 35de87f973
commit b7323914b8

View File

@ -263,11 +263,16 @@ class QuteProc(testprocess.Process):
print(data)
return yaml.load(data)
def get_content(self):
def get_content(self, plain=True):
"""Get the contents of the current page."""
with tempfile.TemporaryDirectory() as tmpdir:
path = os.path.join(tmpdir, 'page')
self.send_cmd(':debug-dump-page --plain "{}"'.format(path))
if plain:
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,
message='Dumped page to {}.'.format(path))