mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-23 04:24:00 -07: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:
parent
551e5e4bd5
commit
3cb9b0fa91
9 changed files with 55 additions and 41 deletions
|
@ -105,7 +105,7 @@ class TestSlackModule(ModuleTestCase):
|
|||
self.module.main()
|
||||
|
||||
self.assertTrue(fetch_url_mock.call_count, 1)
|
||||
self.assertEquals(fetch_url_mock.call_args[1]['url'], "https://slack.com/api/chat.postMessage")
|
||||
self.assertEqual(fetch_url_mock.call_args[1]['url'], "https://slack.com/api/chat.postMessage")
|
||||
|
||||
def test_edit_message(self):
|
||||
set_module_args({
|
||||
|
@ -125,9 +125,9 @@ class TestSlackModule(ModuleTestCase):
|
|||
self.module.main()
|
||||
|
||||
self.assertTrue(fetch_url_mock.call_count, 2)
|
||||
self.assertEquals(fetch_url_mock.call_args[1]['url'], "https://slack.com/api/chat.update")
|
||||
self.assertEqual(fetch_url_mock.call_args[1]['url'], "https://slack.com/api/chat.update")
|
||||
call_data = json.loads(fetch_url_mock.call_args[1]['data'])
|
||||
self.assertEquals(call_data['ts'], "12345")
|
||||
self.assertEqual(call_data['ts'], "12345")
|
||||
|
||||
def test_message_with_blocks(self):
|
||||
"""tests sending a message with blocks"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue