def test_main_raises_on_grub_update(self, mock_Command_run,
                                     mock_logger_setup):
     mock_Command_run.side_effect = [
         None,
         Exception,
     ]
     with raises(DistMigrationGrubConfigException):
         main()
 def test_main_raises_on_grub_update(
     self, mock_Command_run,
     mock_info, mock_error
 ):
     mock_Command_run.side_effect = [
         None,
         Exception,
     ]
     with raises(DistMigrationGrubConfigException):
         main()
         assert mock_info.called
         assert mock_error.called
 def test_main(self, mock_Command_run, mock_logger_setup):
     main()
     assert mock_Command_run.call_args_list == [
         call([
             'chroot', '/system-root', 'zypper', '--non-interactive',
             '--no-gpg-checks', 'remove', 'SLE*-Migration',
             'suse-migration-*-activation'
         ],
              raise_on_error=False),
         call([
             'chroot', '/system-root', 'grub2-mkconfig', '-o',
             '/boot/grub2/grub.cfg'
         ])
     ]