mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
[PR #7348/6c9713b3 backport][stable-7] Fix Python 3.12 unit tests (#7351)
Fix Python 3.12 unit tests (#7348)
* Re-enable Python 3.12 unit tests.
* Stop using deprecated alias.
* Stop using long deprecated subset comparison function.
* Avoid another alias.
* Fix name, add Python 2 compatibility.
* Properly make backwards compatible.
(cherry picked from commit 6c9713b36c)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
@@ -140,7 +140,7 @@ class TestJenkinsBuildInfo(unittest.TestCase):
|
||||
|
||||
self.assertFalse(return_json.exception.args[0]['changed'])
|
||||
self.assertTrue(return_json.exception.args[0]['failed'])
|
||||
self.assertEquals("ABSENT", return_json.exception.args[0]['build_info']['result'])
|
||||
self.assertEqual("ABSENT", return_json.exception.args[0]['build_info']['result'])
|
||||
|
||||
@patch('ansible_collections.community.general.plugins.modules.jenkins_build_info.test_dependencies')
|
||||
@patch('ansible_collections.community.general.plugins.modules.jenkins_build_info.JenkinsBuildInfo.get_jenkins_connection')
|
||||
@@ -157,7 +157,7 @@ class TestJenkinsBuildInfo(unittest.TestCase):
|
||||
jenkins_build_info.main()
|
||||
|
||||
self.assertFalse(return_json.exception.args[0]['changed'])
|
||||
self.assertEquals("SUCCESS", return_json.exception.args[0]['build_info']['result'])
|
||||
self.assertEqual("SUCCESS", return_json.exception.args[0]['build_info']['result'])
|
||||
|
||||
@patch('ansible_collections.community.general.plugins.modules.jenkins_build_info.test_dependencies')
|
||||
@patch('ansible_collections.community.general.plugins.modules.jenkins_build_info.JenkinsBuildInfo.get_jenkins_connection')
|
||||
@@ -177,4 +177,4 @@ class TestJenkinsBuildInfo(unittest.TestCase):
|
||||
|
||||
self.assertFalse(return_json.exception.args[0]['changed'])
|
||||
self.assertTrue(return_json.exception.args[0]['failed'])
|
||||
self.assertEquals("ABSENT", return_json.exception.args[0]['build_info']['result'])
|
||||
self.assertEqual("ABSENT", return_json.exception.args[0]['build_info']['result'])
|
||||
|
||||
Reference in New Issue
Block a user