mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
upgrades: Cleanup use of return value from _apt_run
_apt_run does not return anything. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> [sunil: Update test case] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Tested-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
1 parent
97cc901fe6
commit
e4586eeb72
2 files changed
+1
-9
No files matched your search
@@ -338,11 +338,7 @@ def _apt_autoremove():
|
||||
def _apt_full_upgrade():
|
||||
"""Run and check if apt upgrade was successful."""
|
||||
logger.info('Running apt full-upgrade...')
|
||||
returncode = _apt_run(['full-upgrade'])
|
||||
if returncode:
|
||||
raise RuntimeError(
|
||||
'Apt full-upgrade was not successful. Distribution upgrade '
|
||||
'will be retried at a later time.')
|
||||
_apt_run(['full-upgrade'])
|
||||
|
||||
|
||||
def _unattended_upgrades_run():
|
||||
|
||||
@@ -396,10 +396,6 @@ def test_apt_full_upgrade(apt_run):
|
||||
distupgrade._apt_full_upgrade()
|
||||
apt_run.assert_called_with(['full-upgrade'])
|
||||
|
||||
apt_run.return_value = 1
|
||||
with pytest.raises(RuntimeError):
|
||||
distupgrade._apt_full_upgrade()
|
||||
|
||||
|
||||
@patch('subprocess.run')
|
||||
def test_unatteneded_upgrades_run(run):
|
||||
|
||||
Reference in new issue
Block a user