mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-06-28 06:41:43 +00:00
add patches to clean command
This commit is contained in:
@ -17,6 +17,7 @@ def _default_args(args: argparse.Namespace) -> argparse.Namespace:
|
||||
args.no_chroot = False
|
||||
args.no_manual = False
|
||||
args.no_packages = False
|
||||
args.no_patches = False
|
||||
return args
|
||||
|
||||
|
||||
|
@ -212,7 +212,7 @@ def test_clean_build(application: Application, mocker: MockerFixture) -> None:
|
||||
must clean build directory
|
||||
"""
|
||||
clear_mock = mocker.patch("ahriman.core.repository.cleaner.Cleaner.clear_build")
|
||||
application.clean(False, True, True, True, True)
|
||||
application.clean(False, True, True, True, True, True)
|
||||
clear_mock.assert_called_once()
|
||||
|
||||
|
||||
@ -221,7 +221,7 @@ def test_clean_cache(application: Application, mocker: MockerFixture) -> None:
|
||||
must clean cache directory
|
||||
"""
|
||||
clear_mock = mocker.patch("ahriman.core.repository.cleaner.Cleaner.clear_cache")
|
||||
application.clean(True, False, True, True, True)
|
||||
application.clean(True, False, True, True, True, True)
|
||||
clear_mock.assert_called_once()
|
||||
|
||||
|
||||
@ -230,7 +230,7 @@ def test_clean_chroot(application: Application, mocker: MockerFixture) -> None:
|
||||
must clean chroot directory
|
||||
"""
|
||||
clear_mock = mocker.patch("ahriman.core.repository.cleaner.Cleaner.clear_chroot")
|
||||
application.clean(True, True, False, True, True)
|
||||
application.clean(True, True, False, True, True, True)
|
||||
clear_mock.assert_called_once()
|
||||
|
||||
|
||||
@ -239,7 +239,7 @@ def test_clean_manual(application: Application, mocker: MockerFixture) -> None:
|
||||
must clean manual directory
|
||||
"""
|
||||
clear_mock = mocker.patch("ahriman.core.repository.cleaner.Cleaner.clear_manual")
|
||||
application.clean(True, True, True, False, True)
|
||||
application.clean(True, True, True, False, True, True)
|
||||
clear_mock.assert_called_once()
|
||||
|
||||
|
||||
@ -248,7 +248,16 @@ def test_clean_packages(application: Application, mocker: MockerFixture) -> None
|
||||
must clean packages directory
|
||||
"""
|
||||
clear_mock = mocker.patch("ahriman.core.repository.cleaner.Cleaner.clear_packages")
|
||||
application.clean(True, True, True, True, False)
|
||||
application.clean(True, True, True, True, False, True)
|
||||
clear_mock.assert_called_once()
|
||||
|
||||
|
||||
def test_clean_patches(application: Application, mocker: MockerFixture) -> None:
|
||||
"""
|
||||
must clean packages directory
|
||||
"""
|
||||
clear_mock = mocker.patch("ahriman.core.repository.cleaner.Cleaner.clear_patches")
|
||||
application.clean(True, True, True, True, True, False)
|
||||
clear_mock.assert_called_once()
|
||||
|
||||
|
||||
|
@ -82,3 +82,12 @@ def test_clear_packages(cleaner: Cleaner, mocker: MockerFixture) -> None:
|
||||
|
||||
cleaner.clear_packages()
|
||||
Path.unlink.assert_has_calls([mock.call(), mock.call(), mock.call()])
|
||||
|
||||
|
||||
def test_clear_patches(cleaner: Cleaner, mocker: MockerFixture) -> None:
|
||||
"""
|
||||
must clear directory with patches
|
||||
"""
|
||||
_mock_clear(mocker)
|
||||
cleaner.clear_patches()
|
||||
_mock_clear_check()
|
||||
|
Reference in New Issue
Block a user