From d266ac6a3f32d57e31f3b181276177c67cc85aaa Mon Sep 17 00:00:00 2001 From: Dan Bungert Date: Mon, 26 Feb 2024 16:59:21 -0700 Subject: [PATCH 1/2] server: fix py3.12 related unittest deprecation --- subiquity/server/tests/test_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subiquity/server/tests/test_controller.py b/subiquity/server/tests/test_controller.py index 89592aa7..84b37754 100644 --- a/subiquity/server/tests/test_controller.py +++ b/subiquity/server/tests/test_controller.py @@ -83,7 +83,7 @@ class TestController(SubiTestCase): exception = ctx.exception # Assert error section is based on autoinstall_key - self.assertEquals(exception.owner, "some-key") + self.assertEqual(exception.owner, "some-key") # Assert apport report is not created # This only checks that controllers do not manually create an apport From 76c9b6607a1ba954a9f971d4f0b213c48fa19eee Mon Sep 17 00:00:00 2001 From: Dan Bungert Date: Mon, 26 Feb 2024 17:05:37 -0700 Subject: [PATCH 2/2] console_conf: fix not_called usage --- console_conf/controllers/tests/test_chooser.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/console_conf/controllers/tests/test_chooser.py b/console_conf/controllers/tests/test_chooser.py index 1349b483..6c5a6d82 100644 --- a/console_conf/controllers/tests/test_chooser.py +++ b/console_conf/controllers/tests/test_chooser.py @@ -148,9 +148,10 @@ class TestChooserController(unittest.TestCase): # go back now c.back() c.ui.set_body.assert_called_with("current") + c.ui.set_body.reset_mock() # nothing c.back() - c.ui.set_body.not_called() + c.ui.set_body.assert_not_called() @mock.patch( "console_conf.controllers.chooser.ChooserCurrentSystemView", @@ -169,7 +170,7 @@ class TestChooserController(unittest.TestCase): self.assertEqual(v, "current") # going back does nothing c.back() - c.ui.set_body.not_called() + c.ui.set_body.assert_not_called() @mock.patch( "console_conf.controllers.chooser.ChooserCurrentSystemView",