[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:
patchback[bot] 2023-10-05 06:36:50 +02:00 committed by GitHub
commit 3cb9b0fa91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 55 additions and 41 deletions

View file

@ -22,9 +22,9 @@ class PagerDutyAlertsTest(unittest.TestCase):
return Response(), {'status': 200}
def _assert_compatibility_header(self, module, url, method, headers):
self.assertDictContainsSubset(
{'Accept': 'application/vnd.pagerduty+json;version=2'},
headers,
self.assertEqual(
'application/vnd.pagerduty+json;version=2',
headers.get('Accept'),
'Accept:application/vnd.pagerduty+json;version=2 HTTP header not found'
)
return Response(), {'status': 200}