tests: Add quteproc.get_content.

This commit is contained in:
Florian Bruhin 2015-11-23 14:37:29 +01:00
parent 31892b437e
commit 76143574ef

View File

@ -263,6 +263,15 @@ class QuteProc(testprocess.Process):
print(data)
return yaml.load(data)
def get_content(self):
"""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))
with open(path, 'r', encoding='utf-8') as f:
return f.read()
@pytest.yield_fixture(scope='module')
def quteproc(qapp, httpbin, request):