mirror of
				https://github.com/arcan1s/ahriman.git
				synced 2025-11-04 07:43:42 +00:00 
			
		
		
		
	add now argument to add command
This commit is contained in:
		@ -8,6 +8,7 @@ from ahriman.core.configuration import Configuration
 | 
			
		||||
 | 
			
		||||
def _default_args(args: argparse.Namespace) -> argparse.Namespace:
 | 
			
		||||
    args.package = []
 | 
			
		||||
    args.now = False
 | 
			
		||||
    args.without_dependencies = False
 | 
			
		||||
    return args
 | 
			
		||||
 | 
			
		||||
@ -22,3 +23,19 @@ def test_run(args: argparse.Namespace, configuration: Configuration, mocker: Moc
 | 
			
		||||
 | 
			
		||||
    Add.run(args, "x86_64", configuration)
 | 
			
		||||
    application_mock.assert_called_once()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_run_with_updates(args: argparse.Namespace, configuration: Configuration, mocker: MockerFixture) -> None:
 | 
			
		||||
    """
 | 
			
		||||
    must run command with updates after
 | 
			
		||||
    """
 | 
			
		||||
    args = _default_args(args)
 | 
			
		||||
    args.now = True
 | 
			
		||||
    mocker.patch("pathlib.Path.mkdir")
 | 
			
		||||
    mocker.patch("ahriman.application.application.Application.add")
 | 
			
		||||
    application_mock = mocker.patch("ahriman.application.application.Application.update")
 | 
			
		||||
    updates_mock = mocker.patch("ahriman.application.application.Application.get_updates")
 | 
			
		||||
 | 
			
		||||
    Add.run(args, "x86_64", configuration)
 | 
			
		||||
    application_mock.assert_called_once()
 | 
			
		||||
    updates_mock.assert_called_once()
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user