Merge pull request #1920 from dbungert/tests-noble

Fix unittests on Noble
This commit is contained in:
Dan Bungert 2024-02-26 23:58:57 -07:00 committed by GitHub
commit d886dcd97d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -148,9 +148,10 @@ class TestChooserController(unittest.TestCase):
# go back now # go back now
c.back() c.back()
c.ui.set_body.assert_called_with("current") c.ui.set_body.assert_called_with("current")
c.ui.set_body.reset_mock()
# nothing # nothing
c.back() c.back()
c.ui.set_body.not_called() c.ui.set_body.assert_not_called()
@mock.patch( @mock.patch(
"console_conf.controllers.chooser.ChooserCurrentSystemView", "console_conf.controllers.chooser.ChooserCurrentSystemView",
@ -169,7 +170,7 @@ class TestChooserController(unittest.TestCase):
self.assertEqual(v, "current") self.assertEqual(v, "current")
# going back does nothing # going back does nothing
c.back() c.back()
c.ui.set_body.not_called() c.ui.set_body.assert_not_called()
@mock.patch( @mock.patch(
"console_conf.controllers.chooser.ChooserCurrentSystemView", "console_conf.controllers.chooser.ChooserCurrentSystemView",

View File

@ -83,7 +83,7 @@ class TestController(SubiTestCase):
exception = ctx.exception exception = ctx.exception
# Assert error section is based on autoinstall_key # 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 # Assert apport report is not created
# This only checks that controllers do not manually create an apport # This only checks that controllers do not manually create an apport