[packages/python3-dbus-deviation] - fixed tests, improved docs

qboosh qboosh at pld-linux.org
Wed Apr 2 18:11:09 CEST 2025


commit 6ca5f35eb4cf798bbac1fc9017d5cc685e4a9c6f
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Apr 2 17:45:07 2025 +0200

    - fixed tests, improved docs

 dbus-deviation-tests.patch  | 62 +++++++++++++++++++++++++++++++++++++++++++++
 python3-dbus-deviation.spec | 10 +++++++-
 2 files changed, 71 insertions(+), 1 deletion(-)
---
diff --git a/python3-dbus-deviation.spec b/python3-dbus-deviation.spec
index aec1127..d24639e 100644
--- a/python3-dbus-deviation.spec
+++ b/python3-dbus-deviation.spec
@@ -13,6 +13,7 @@ Group:		Libraries/Python
 #Source0Download: https://pypi.org/simple/dbus-deviation/
 Source0:	https://files.pythonhosted.org/packages/source/d/dbus-deviation/dbus-deviation-%{version}.tar.gz
 # Source0-md5:	649e1024a024242bfc38a5e1dfec69b4
+Patch0:		dbus-deviation-tests.patch
 URL:		https://pypi.org/project/dbus-deviation/
 BuildRequires:	python3-Sphinx
 BuildRequires:	python3-modules >= 1:3.2
@@ -60,11 +61,18 @@ Dokumentacja API modułu Pythona dbus-deviation.
 
 %prep
 %setup -q -n dbus-deviation-%{version}
+%patch -P0 -p1
 
 %build
-%py3_build %{?with_tests:test}
+%py3_build
+
+%if %{with tests}
+%{__python3} -m unittest discover -s dbusapi
+%{__python3} -m unittest discover -s dbusdeviation
+%endif
 
 %if %{with doc}
+PYTHONPATH=$(pwd) \
 sphinx-build-3 -b html docs docs/build/html
 %endif
 
diff --git a/dbus-deviation-tests.patch b/dbus-deviation-tests.patch
new file mode 100644
index 0000000..40b8ad2
--- /dev/null
+++ b/dbus-deviation-tests.patch
@@ -0,0 +1,62 @@
+--- dbus-deviation-0.6.1/dbusapi/tests/test_interfaceparser.py.orig	2017-01-10 10:18:04.000000000 +0100
++++ dbus-deviation-0.6.1/dbusapi/tests/test_interfaceparser.py	2025-04-02 17:41:21.325562540 +0200
+@@ -459,13 +459,13 @@ class TestParserNormal(unittest.TestCase
+         (parser, interfaces, _) = _test_parser(xml)
+         interface = interfaces.get('I.I')
+         self.assertIsNotNone(interface)
+-        self.assertEquals(interface.comment, "Please consider me")
++        self.assertEqual(interface.comment, "Please consider me")
+         meth = interface.methods.get('foo')
+         self.assertIsNotNone(meth)
+-        self.assertEquals(meth.comment, "Notice me too")
+-        self.assertEquals(len(meth.arguments), 1)
++        self.assertEqual(meth.comment, "Notice me too")
++        self.assertEqual(len(meth.arguments), 1)
+         arg = meth.arguments[0]
+-        self.assertEquals(arg.comment, "And me!")
++        self.assertEqual(arg.comment, "And me!")
+ 
+     def test_line_numbers(self):
+         """Test that line numbers are correctly computed"""
+@@ -498,7 +498,7 @@ class TestParserNormal(unittest.TestCase
+         self.assertIsNotNone(meth)
+         self.assertEqual(meth.line_number, 9)
+         self.assertEqual(meth.comment_line_number, 6)
+-        self.assertEquals(len(meth.arguments), 2)
++        self.assertEqual(len(meth.arguments), 2)
+         arg = meth.arguments[0]
+         self.assertEqual(arg.line_number, 13)
+         self.assertEqual(arg.comment_line_number, 10)
+@@ -517,7 +517,7 @@ class TestParserNormal(unittest.TestCase
+         (parser, interfaces, _) = _test_parser(xml)
+         interface = interfaces.get('I.I')
+         self.assertIsNotNone(interface)
+-        self.assertEquals(interface.comment, "bla")
++        self.assertEqual(interface.comment, "bla")
+ 
+     def test_multiline_comments(self):
+         xml = ("<node xmlns:tp='"
+@@ -534,7 +534,7 @@ class TestParserNormal(unittest.TestCase
+         (parser, interfaces, _) = _test_parser(xml)
+         interface = interfaces.get('I.I')
+         self.assertIsNotNone(interface)
+-        self.assertEquals(interface.comment,
++        self.assertEqual(interface.comment,
+                           "    Please consider that\n"
+                           "    multiline comment")
+ 
+--- dbus-deviation-0.6.1/dbusapi/tests/test_ast.py.orig	2017-01-10 10:18:04.000000000 +0100
++++ dbus-deviation-0.6.1/dbusapi/tests/test_ast.py	2025-04-02 17:41:24.062565176 +0200
+@@ -227,9 +227,9 @@ class TestAstTraversal(unittest.TestCase
+         })
+ 
+         children = [node for node in iface.walk()]
+-        self.assertEquals(len(children), 2)
+-        self.assertEquals(children[0], method)
+-        self.assertEquals(children[1], annotation)
++        self.assertEqual(len(children), 2)
++        self.assertEqual(children[0], method)
++        self.assertEqual(children[1], annotation)
+ 
+ 
+ class TestAstSignatures(unittest.TestCase):
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-dbus-deviation.git/commitdiff/6ca5f35eb4cf798bbac1fc9017d5cc685e4a9c6f



More information about the pld-cvs-commit mailing list