From 97d2164e04cd8458daacc42bc6030055dcb61ffff6811e595c1f67e399b45944 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Tue, 5 Mar 2024 22:44:27 +0000 Subject: [PATCH] Accepting request 1155367 from home:jaimeMF:branches:devel:languages:python - Actually run the correct tests - Fix the fdupes call - Add 0001-Remove-calls-to-the-deprecated-method-assertEquals.patch OBS-URL: https://build.opensuse.org/request/show/1155367 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pymilter?expand=0&rev=15 --- ...o-the-deprecated-method-assertEquals.patch | 65 +++++++++++++++++++ python-pymilter.changes | 7 ++ python-pymilter.spec | 8 ++- 3 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 0001-Remove-calls-to-the-deprecated-method-assertEquals.patch diff --git a/0001-Remove-calls-to-the-deprecated-method-assertEquals.patch b/0001-Remove-calls-to-the-deprecated-method-assertEquals.patch new file mode 100644 index 0000000..a976fa2 --- /dev/null +++ b/0001-Remove-calls-to-the-deprecated-method-assertEquals.patch @@ -0,0 +1,65 @@ +From 1ead9028fc63ae3ec6ea3b0c438e6ed088a2b20e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= + +Date: Tue, 5 Mar 2024 19:14:30 +0100 +Subject: [PATCH] Remove calls to the deprecated method "assertEquals" +Reference: https://github.com/sdgathman/pymilter/pull/57 + +It has been removed in python 3.12 +--- + testsample.py | 6 +++--- + testutils.py | 4 ++-- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/testsample.py b/testsample.py +index 100d1a6..70222bf 100644 +--- a/testsample.py ++++ b/testsample.py +@@ -31,7 +31,7 @@ class BMSMilterTestCase(unittest.TestCase): + count = 10 + while count > 0: + rc = ctx._connect(helo='milter-template.example.org') +- self.assertEquals(rc,Milter.CONTINUE) ++ self.assertEqual(rc,Milter.CONTINUE) + with open('test/'+fname,'rb') as fp: + rc = ctx._feedFile(fp) + milter = ctx.getpriv() +@@ -46,7 +46,7 @@ class BMSMilterTestCase(unittest.TestCase): + ctx._setsymval('{auth_type}','batcomputer') + ctx._setsymval('j','mailhost') + rc = ctx._connect() +- self.assertEquals(rc,Milter.CONTINUE) ++ self.assertEqual(rc,Milter.CONTINUE) + with open('test/'+fname,'rb') as fp: + rc = ctx._feedFile(fp) + milter = ctx.getpriv() +@@ -69,7 +69,7 @@ class BMSMilterTestCase(unittest.TestCase): + milter = ctx.getpriv() + # self.assertTrue(milter.user == 'batman',"getsymval failed: "+ + # "%s != %s"%(milter.user,'batman')) +- self.assertEquals(milter.user,'batman') ++ self.assertEqual(milter.user,'batman') + self.assertTrue(milter.auth_type != 'batcomputer',"setsymlist failed") + self.assertTrue(rc == Milter.ACCEPT) + self.assertTrue(ctx._bodyreplaced,"Message body not replaced") +diff --git a/testutils.py b/testutils.py +index 56ec161..93e078c 100644 +--- a/testutils.py ++++ b/testutils.py +@@ -24,11 +24,11 @@ class AddrCacheTestCase(unittest.TestCase): + self.assertTrue(cache.has_key('foo@bar.com')) + self.assertTrue(not cache.has_key('hello@bar.com')) + self.assertTrue('baz@bar.com' in cache) +- self.assertEquals(cache['temp@bar.com'],'testing') ++ self.assertEqual(cache['temp@bar.com'],'testing') + s = open(self.fname).readlines() + self.assertTrue(len(s) == 2) + self.assertTrue(s[0].startswith('foo@bar.com ')) +- self.assertEquals(s[1].strip(),'baz@bar.com') ++ self.assertEqual(s[1].strip(),'baz@bar.com') + # check that new result overrides old + cache['temp@bar.com'] = None + self.assertTrue(not cache['temp@bar.com']) +-- +2.44.0 + diff --git a/python-pymilter.changes b/python-pymilter.changes index c82d6e9..37ffe03 100644 --- a/python-pymilter.changes +++ b/python-pymilter.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Mar 5 18:22:42 UTC 2024 - Jaime Marquínez Ferrándiz + +- Actually run the correct tests +- Fix the fdupes call +- Add 0001-Remove-calls-to-the-deprecated-method-assertEquals.patch + ------------------------------------------------------------------- Sat Jan 7 23:24:10 UTC 2023 - Dirk Müller diff --git a/python-pymilter.spec b/python-pymilter.spec index c349f20..3709f1d 100644 --- a/python-pymilter.spec +++ b/python-pymilter.spec @@ -30,6 +30,8 @@ License: GPL-2.0-or-later URL: https://www.bmsi.com/python/milter.html Source0: https://github.com/sdgathman/pymilter/archive/pymilter-%{version}.tar.gz Source1: tmpfiles-python-pymilter.conf +# PATCH-FIX-UPSTREAM: https://github.com/sdgathman/pymilter/pull/57 +Patch1: 0001-Remove-calls-to-the-deprecated-method-assertEquals.patch BuildRequires: %{python_module bsddb3} BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} @@ -72,10 +74,12 @@ mkdir -p %{buildroot}%{_libexecdir}/milter mkdir -p %{buildroot}%{_tmpfilesdir} install -m 0644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf -%fdupes %{buildroot}%{python_sitearch} +%python_expand %fdupes %{buildroot}/%{$python_sitearch} %check -%pyunittest_arch -v -k "not testPolicy" +# remove tests that don't work +rm test.py testpolicy.py +%pyunittest_arch -v %files %{python_files} %doc README.md ChangeLog NEWS TODO CREDITS sample.py template.py