Fix compatibility with Python 3.12+
Refresh unit test assertions for hard removals in Python 3.12. Change-Id: I80f64a47f81dc0314823cd6df6283a0c0603a387
This commit is contained in:
parent
07bbdcb806
commit
04a12ecccf
@ -99,7 +99,7 @@ class PauseTestCase(CharmTestCase):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
self.service_pause.side_effect = maybe_kill
|
self.service_pause.side_effect = maybe_kill
|
||||||
self.assertRaisesRegexp(
|
self.assertRaisesRegex(
|
||||||
Exception, "swift-container didn't stop cleanly.",
|
Exception, "swift-container didn't stop cleanly.",
|
||||||
actions.actions.pause, self.args)
|
actions.actions.pause, self.args)
|
||||||
self.assertEqual(pause_calls, ['swift-account',
|
self.assertEqual(pause_calls, ['swift-account',
|
||||||
@ -174,7 +174,7 @@ class ResumeTestCase(CharmTestCase):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
self.service_resume.side_effect = maybe_kill
|
self.service_resume.side_effect = maybe_kill
|
||||||
self.assertRaisesRegexp(
|
self.assertRaisesRegex(
|
||||||
Exception, "swift-container didn't start cleanly.",
|
Exception, "swift-container didn't start cleanly.",
|
||||||
actions.actions.resume, self.args)
|
actions.actions.resume, self.args)
|
||||||
self.assertEqual(resume_calls, ['swift-account',
|
self.assertEqual(resume_calls, ['swift-account',
|
||||||
|
@ -90,7 +90,7 @@ class SwiftStorageContextTests(CharmTestCase):
|
|||||||
'object_rsync_timeout': 1000,
|
'object_rsync_timeout': 1000,
|
||||||
'object_lockup_timeout': 2010,
|
'object_lockup_timeout': 2010,
|
||||||
}
|
}
|
||||||
self.assertDictContainsSubset(ex, result)
|
self.assertEqual(result, result | ex)
|
||||||
|
|
||||||
def test_swift_storage_server_context(self):
|
def test_swift_storage_server_context(self):
|
||||||
self.unit_private_ip.return_value = '10.0.0.5'
|
self.unit_private_ip.return_value = '10.0.0.5'
|
||||||
|
Loading…
Reference in New Issue
Block a user