summaryrefslogtreecommitdiff
path: root/tests/unit/utils/test_qtutils.py
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2019-05-22 19:13:50 +0200
committerFlorian Bruhin <me@the-compiler.org>2019-05-22 19:13:50 +0200
commit394c2bdb7d9a1f1147171484ea6c5d3c6ae1322c (patch)
tree0373d90436c73e53baa33cfe81ee60fe1fac2983 /tests/unit/utils/test_qtutils.py
parent2444090747267688242704fc2579674757b7350e (diff)
downloadqutebrowser-394c2bdb7d9a1f1147171484ea6c5d3c6ae1322c.tar.gz
qutebrowser-394c2bdb7d9a1f1147171484ea6c5d3c6ae1322c.zip
Add tests for qtutils.is_single_process()
Diffstat (limited to 'tests/unit/utils/test_qtutils.py')
-rw-r--r--tests/unit/utils/test_qtutils.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/unit/utils/test_qtutils.py b/tests/unit/utils/test_qtutils.py
index ccdd2bf50..a61bac43a 100644
--- a/tests/unit/utils/test_qtutils.py
+++ b/tests/unit/utils/test_qtutils.py
@@ -31,7 +31,7 @@ from PyQt5.QtCore import (QDataStream, QPoint, QUrl, QByteArray, QIODevice,
QTimer, QBuffer, QFile, QProcess, QFileDevice)
from PyQt5.QtGui import QColor
-from qutebrowser.utils import qtutils, utils
+from qutebrowser.utils import qtutils, utils, usertypes
import overflow_test_cases
if utils.is_linux:
@@ -112,6 +112,18 @@ def test_is_new_qtwebkit(monkeypatch, version, is_new):
assert qtutils.is_new_qtwebkit() == is_new
+@pytest.mark.parametrize('backend, arguments, single_process', [
+ (usertypes.Backend.QtWebKit, ['--single-process'], False),
+ (usertypes.Backend.QtWebEngine, ['--single-process'], True),
+ (usertypes.Backend.QtWebEngine, [], False),
+])
+def test_is_single_process(monkeypatch, stubs, backend, arguments, single_process):
+ qapp = stubs.FakeQApplication(arguments=arguments)
+ monkeypatch.setattr(qtutils, 'QApplication', qapp)
+ monkeypatch.setattr(qtutils.objects, 'backend', backend)
+ assert qtutils.is_single_process() == single_process
+
+
class TestCheckOverflow:
"""Test check_overflow."""