From fb4bed534ec037cd9945858fe2616a8362503f26 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 14 Jun 2021 12:51:50 +0200 Subject: [PATCH] Work-around error text changes https://github.com/martinpitt/python-dbusmock/issues/74 --- 0001-Work-around-error-text-changes.patch | 37 +++++++++++++++++++++++ python-dbusmock.spec | 3 ++ 2 files changed, 40 insertions(+) create mode 100644 0001-Work-around-error-text-changes.patch diff --git a/0001-Work-around-error-text-changes.patch b/0001-Work-around-error-text-changes.patch new file mode 100644 index 0000000..22da1fe --- /dev/null +++ b/0001-Work-around-error-text-changes.patch @@ -0,0 +1,37 @@ +From e0f4a08a1ed9fce9d693010641c2f40345b47f7c Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Mon, 14 Jun 2021 13:02:17 +0200 +Subject: [PATCH 1/2] Work-around error text changes + +https://github.com/martinpitt/python-dbusmock/issues/74 +--- + tests/test_api.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/tests/test_api.py b/tests/test_api.py +index c042e69..0766d91 100644 +--- a/tests/test_api.py ++++ b/tests/test_api.py +@@ -202,7 +202,8 @@ assert args[2] == 5 + + # type mismatch + check('u', [-1], 'convert negative value to unsigned') +- check('i', ['hello'], 'TypeError: an integer is required') ++ check('i', ['hello'], 'object cannot be interpreted as an integer') ++ check('i', ['hello'], 'TypeError') + check('s', [1], 'TypeError: Expected a string') + + def test_add_object(self): +@@ -527,7 +528,8 @@ assert args[2] == 5 + + # type mismatch + check('u', [-1], 'convert negative value to unsigned') +- check('i', ['hello'], 'TypeError: an integer is required') ++ check('i', ['hello'], 'object cannot be interpreted as an integer') ++ check('i', ['hello'], 'TypeError') + check('s', [1], 'TypeError: Expected a string') + + def test_dbus_get_log(self): +-- +2.31.1 + diff --git a/python-dbusmock.spec b/python-dbusmock.spec index 249bc54..fa75b12 100644 --- a/python-dbusmock.spec +++ b/python-dbusmock.spec @@ -18,6 +18,9 @@ BuildRequires: python3-gobject BuildRequires: dbus-x11 BuildRequires: upower +# https://github.com/martinpitt/python-dbusmock/issues/74 +Patch0: 0001-Work-around-error-text-changes.patch + %global _description\ With this program/Python library you can easily create mock objects on\ D-Bus. This is useful for writing tests for software which talks to\