From f5febc4807007f1dffa19f9808cde41d54712e45 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 28 Nov 2015 23:35:32 +0100 Subject: [PATCH] Log basedir and save it in QuteProcess for tests. --- qutebrowser/utils/standarddir.py | 1 + tests/integration/quteprocess.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/qutebrowser/utils/standarddir.py b/qutebrowser/utils/standarddir.py index 4464cdfb4..2f416e35a 100644 --- a/qutebrowser/utils/standarddir.py +++ b/qutebrowser/utils/standarddir.py @@ -190,6 +190,7 @@ def _maybe_create(path): def init(args): """Initialize all standard dirs.""" global _args + log.init.debug("Base directory: {}".format(args.basedir)) _args = args _init_cachedir_tag() diff --git a/tests/integration/quteprocess.py b/tests/integration/quteprocess.py index 04a99a5fe..f60e4d026 100644 --- a/tests/integration/quteprocess.py +++ b/tests/integration/quteprocess.py @@ -119,6 +119,7 @@ class QuteProc(testprocess.Process): _delay: Delay to wait between commands. _ipc_socket: The IPC socket of the started instance. _httpbin: The HTTPBin webserver. + basedir: The base directory for this instance. Signals: got_error: Emitted when there was an error log line. @@ -134,6 +135,7 @@ class QuteProc(testprocess.Process): self._delay = delay self._httpbin = httpbin self._ipc_socket = None + self.basedir = None def _parse_line(self, line): try: @@ -163,6 +165,11 @@ class QuteProc(testprocess.Process): elif (log_line.category == 'webview' and log_line.message == start_okay_message): self.ready.emit() + elif (log_line.category == 'init' and + log_line.module == 'standarddir' and + log_line.function == 'init' and + log_line.message.startswith('Base directory:')): + self.basedir = log_line.message.split(':', maxsplit=1)[1].strip() elif log_line.loglevel > logging.INFO: self.got_error.emit()