manifestv2: fix backup tests

This commit is contained in:
Alexandre Aubin 2022-04-27 22:18:24 +02:00
parent 61d7ba1e40
commit d5fcc38281
2 changed files with 3 additions and 3 deletions

View file

@ -1513,7 +1513,7 @@ class RestoreManager:
operation_logger.extra["env"] = env_dict operation_logger.extra["env"] = env_dict
operation_logger.flush() operation_logger.flush()
manifest = _get_manifest_of_app(app_dir_in_archive) manifest = _get_manifest_of_app(app_settings_in_archive)
if manifest["packaging_format"] >= 2: if manifest["packaging_format"] >= 2:
from yunohost.utils.resources import AppResourceManager from yunohost.utils.resources import AppResourceManager
try: try:

View file

@ -355,13 +355,13 @@ def test_backup_script_failure_handling(monkeypatch, mocker):
@pytest.mark.with_backup_recommended_app_installed @pytest.mark.with_backup_recommended_app_installed
def test_backup_not_enough_free_space(monkeypatch, mocker): def test_backup_not_enough_free_space(monkeypatch, mocker):
def custom_disk_usage(path): def custom_space_used_by_directory(path, *args, **kwargs):
return 99999999999999999 return 99999999999999999
def custom_free_space_in_directory(dirpath): def custom_free_space_in_directory(dirpath):
return 0 return 0
monkeypatch.setattr("yunohost.backup.disk_usage", custom_disk_usage) monkeypatch.setattr("yunohost.backup.space_used_by_directory", custom_space_used_by_directory)
monkeypatch.setattr( monkeypatch.setattr(
"yunohost.backup.free_space_in_directory", custom_free_space_in_directory "yunohost.backup.free_space_in_directory", custom_free_space_in_directory
) )