mirror of
				https://github.com/arcan1s/ahriman.git
				synced 2025-11-03 23:33:41 +00:00 
			
		
		
		
	handle exceptions in actual_version calls
This commit is contained in:
		@ -97,11 +97,22 @@ def test_actual_version_vcs(package_tpacpi_bat_git: Package, repository_paths: R
 | 
			
		||||
    srcinfo = (resource_path_root / "models" / "package_tpacpi-bat-git_srcinfo").read_text()
 | 
			
		||||
 | 
			
		||||
    mocker.patch("ahriman.models.package.Package._check_output", return_value=srcinfo)
 | 
			
		||||
    mocker.patch("ahriman.core.build_tools.task.Task.fetch", return_value=None)
 | 
			
		||||
    mocker.patch("ahriman.core.build_tools.task.Task.fetch")
 | 
			
		||||
 | 
			
		||||
    assert package_tpacpi_bat_git.actual_version(repository_paths) == "3.1.r13.g4959b52-1"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_actual_version_vcs_failed(package_tpacpi_bat_git: Package, repository_paths: RepositoryPaths,
 | 
			
		||||
                                   mocker: MockerFixture) -> None:
 | 
			
		||||
    """
 | 
			
		||||
    must return same version in case if exception occurred
 | 
			
		||||
    """
 | 
			
		||||
    mocker.patch("ahriman.models.package.Package._check_output", side_effect=Exception())
 | 
			
		||||
    mocker.patch("ahriman.core.build_tools.task.Task.fetch")
 | 
			
		||||
 | 
			
		||||
    assert package_tpacpi_bat_git.actual_version(repository_paths) == package_tpacpi_bat_git.version
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def test_is_outdated_false(package_ahriman: Package, repository_paths: RepositoryPaths) -> None:
 | 
			
		||||
    """
 | 
			
		||||
    must be not outdated for the same package
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user