tests/fprintd: fix tests to use new GLib version

Tests, that uses GLib.GError with bytes instead of strings type for
message were broken when implementation was changed in GLib update.
Should use GError calls with decode call to fix it.

Signed-off-by: Aleksandr Dovydenkov <asd@altlinux.org>
This commit is contained in:
Aleksandr Dovydenkov 2025-12-05 16:12:50 +03:00
parent 3c7baf704c
commit ec2a995c36

View file

@ -592,10 +592,10 @@ class FPrintdTest(dbusmock.DBusTestCase):
proc = self.gdbus_device_method_call_process(method, args) proc = self.gdbus_device_method_call_process(method, args)
proc.wait(timeout=5) proc.wait(timeout=5)
if proc.returncode != 0: if proc.returncode != 0:
raise GLib.GError(proc.stdout.read()) raise GLib.GError(proc.stdout.read().decode())
return proc.stdout.read() return proc.stdout.read()
except subprocess.TimeoutExpired as e: except subprocess.TimeoutExpired as e:
raise GLib.GError(e.output) raise GLib.GError(e.output.decode())
class FPrintdVirtualImageDeviceBaseTests(FPrintdTest): class FPrintdVirtualImageDeviceBaseTests(FPrintdTest):
@ -2990,7 +2990,7 @@ class FPrindConcurrentPolkitRequestsTest(FPrintdVirtualStorageDeviceBaseTest):
gdbus.wait() gdbus.wait()
with self.assertFprintError('AlreadyInUse'): with self.assertFprintError('AlreadyInUse'):
raise GLib.GError(gdbus.stdout.read()) raise GLib.GError(gdbus.stdout.read().decode())
self.device.Release() self.device.Release()
@ -3032,7 +3032,7 @@ class FPrindConcurrentPolkitRequestsTest(FPrintdVirtualStorageDeviceBaseTest):
gdbus.wait() gdbus.wait()
with self.assertFprintError('AlreadyInUse'): with self.assertFprintError('AlreadyInUse'):
raise GLib.GError(gdbus.stdout.read()) raise GLib.GError(gdbus.stdout.read().decode())
self.device.Release() self.device.Release()