From 76143574ef21f9cc092c961302358f36669398eb Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 23 Nov 2015 14:37:29 +0100 Subject: [PATCH] tests: Add quteproc.get_content. --- tests/integration/quteprocess.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/integration/quteprocess.py b/tests/integration/quteprocess.py index 3645d7073..f080e22b0 100644 --- a/tests/integration/quteprocess.py +++ b/tests/integration/quteprocess.py @@ -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):