summaryrefslogtreecommitdiff
path: root/tests/end2end
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-08-26 16:47:12 +0200
committerFlorian Bruhin <me@the-compiler.org>2021-08-26 16:47:12 +0200
commitac9d67cce0dbecdde14c474db855243e9746ba04 (patch)
treeb564440308dc40b8ae40209a33cb1c47c95e17c6 /tests/end2end
parentba30ac2af0860a8c92503179f6867ab0b46e3d31 (diff)
downloadqutebrowser-ac9d67cce0dbecdde14c474db855243e9746ba04.tar.gz
qutebrowser-ac9d67cce0dbecdde14c474db855243e9746ba04.zip
Automatically rewrite enums
See #5904
Diffstat (limited to 'tests/end2end')
-rw-r--r--tests/end2end/fixtures/notificationserver.py10
-rw-r--r--tests/end2end/fixtures/quteprocess.py2
-rw-r--r--tests/end2end/fixtures/test_testprocess.py2
-rw-r--r--tests/end2end/fixtures/testprocess.py4
-rw-r--r--tests/end2end/test_invocations.py4
5 files changed, 11 insertions, 11 deletions
diff --git a/tests/end2end/fixtures/notificationserver.py b/tests/end2end/fixtures/notificationserver.py
index abadde794..d11ab616f 100644
--- a/tests/end2end/fixtures/notificationserver.py
+++ b/tests/end2end/fixtures/notificationserver.py
@@ -82,7 +82,7 @@ class TestNotificationServer(QObject):
notification.DBusNotificationAdapter.PATH,
notification.DBusNotificationAdapter.INTERFACE,
self,
- QDBusConnection.ExportAllSlots,
+ QDBusConnection.RegisterOption.ExportAllSlots,
)
return True
@@ -151,7 +151,7 @@ class TestNotificationServer(QObject):
assert channel_count == (4 if has_alpha else 3)
assert bytes_per_line >= width * channel_count
- qimage_format = QImage.Format_RGBA8888 if has_alpha else QImage.Format_RGB888
+ qimage_format = QImage.Format.Format_RGBA8888 if has_alpha else QImage.Format.Format_RGB888
img = QImage(data, width, height, bytes_per_line, qimage_format)
assert not img.isNull()
assert img.width() == width
@@ -196,7 +196,7 @@ class TestNotificationServer(QObject):
@pyqtSlot(QDBusMessage, result="uint")
def Notify(self, dbus_message: QDBusMessage) -> QDBusArgument:
assert dbus_message.signature() == 'susssasa{sv}i'
- assert dbus_message.type() == QDBusMessage.MethodCallMessage
+ assert dbus_message.type() == QDBusMessage.MessageType.MethodCallMessage
message = self._parse_notify_args(*dbus_message.arguments())
@@ -213,7 +213,7 @@ class TestNotificationServer(QObject):
def GetCapabilities(self, message: QDBusMessage) -> List[str]:
assert not message.signature()
assert not message.arguments()
- assert message.type() == QDBusMessage.MethodCallMessage
+ assert message.type() == QDBusMessage.MessageType.MethodCallMessage
capabilities = ["actions", "x-kde-origin-name"]
if self.supports_body_markup:
@@ -224,7 +224,7 @@ class TestNotificationServer(QObject):
@pyqtSlot(QDBusMessage)
def CloseNotification(self, dbus_message: QDBusMessage) -> None:
assert dbus_message.signature() == 'u'
- assert dbus_message.type() == QDBusMessage.MethodCallMessage
+ assert dbus_message.type() == QDBusMessage.MessageType.MethodCallMessage
message_id = dbus_message.arguments()[0]
self.messages[message_id].closed_via_web = True
diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py
index 1552f51b4..0420548e2 100644
--- a/tests/end2end/fixtures/quteprocess.py
+++ b/tests/end2end/fixtures/quteprocess.py
@@ -853,7 +853,7 @@ class QuteProc(testprocess.Process):
# We really need the same representation that the webview uses in
# its __repr__
- url = utils.elide(qurl.toDisplayString(QUrl.EncodeUnicode), 100)
+ url = utils.elide(qurl.toDisplayString(QUrl.ComponentFormattingOption.EncodeUnicode), 100)
assert url
pattern = re.compile(
diff --git a/tests/end2end/fixtures/test_testprocess.py b/tests/end2end/fixtures/test_testprocess.py
index 0cf5e6041..1bcdb4a3c 100644
--- a/tests/end2end/fixtures/test_testprocess.py
+++ b/tests/end2end/fixtures/test_testprocess.py
@@ -53,7 +53,7 @@ class PythonProcess(testprocess.Process):
def __init__(self, request):
super().__init__(request)
- self.proc.setReadChannel(QProcess.StandardOutput)
+ self.proc.setReadChannel(QProcess.ProcessChannel.StandardOutput)
self.code = None
def _parse_line(self, line):
diff --git a/tests/end2end/fixtures/testprocess.py b/tests/end2end/fixtures/testprocess.py
index c74a1a2b8..5a623fb7c 100644
--- a/tests/end2end/fixtures/testprocess.py
+++ b/tests/end2end/fixtures/testprocess.py
@@ -151,7 +151,7 @@ class Process(QObject):
self._invalid = []
self._data = []
self.proc = QProcess()
- self.proc.setReadChannel(QProcess.StandardError)
+ self.proc.setReadChannel(QProcess.ProcessChannel.StandardError)
self.exit_expected = None # Not started at all yet
def _log(self, line):
@@ -325,7 +325,7 @@ class Process(QObject):
def is_running(self):
"""Check if the process is currently running."""
- return self.proc.state() == QProcess.Running
+ return self.proc.state() == QProcess.ProcessState.Running
def _match_data(self, value, expected):
"""Helper for wait_for to match a given value.
diff --git a/tests/end2end/test_invocations.py b/tests/end2end/test_invocations.py
index 3b8b2f1c8..c3219c701 100644
--- a/tests/end2end/test_invocations.py
+++ b/tests/end2end/test_invocations.py
@@ -262,7 +262,7 @@ def test_version(request):
# can't use quteproc_new here because it's confused by
# early process termination
proc = QProcess()
- proc.setProcessChannelMode(QProcess.SeparateChannels)
+ proc.setProcessChannelMode(QProcess.ProcessChannelMode.SeparateChannels)
proc.start(sys.executable, args)
ok = proc.waitForStarted(2000)
@@ -275,7 +275,7 @@ def test_version(request):
print(stderr)
assert ok
- assert proc.exitStatus() == QProcess.NormalExit
+ assert proc.exitStatus() == QProcess.ExitStatus.NormalExit
match = re.search(r'^qutebrowser\s+v\d+(\.\d+)', stdout, re.MULTILINE)
assert match is not None