Update pester tests
This commit is contained in:
@@ -434,8 +434,8 @@ Function Invoke-GiteaFileDownload {
|
||||
return [PSCustomObject]@{
|
||||
SourceURL = $downloadURL
|
||||
Type = $type
|
||||
Result = 'Success'
|
||||
Error = "Skipped - item is a directory"
|
||||
Result = 'Skipped'
|
||||
Error = $null
|
||||
Timestamp = Get-Date
|
||||
FileSize = $null
|
||||
}
|
||||
@@ -521,7 +521,7 @@ Function Invoke-GiteaFileDownload {
|
||||
Path = $fileOutputPath
|
||||
SourceURL = $downloadURL
|
||||
Type = "file"
|
||||
Result = 'Failure'
|
||||
Result = $null
|
||||
Error = $null
|
||||
Timestamp = Get-Date
|
||||
FileSize = $null
|
||||
@@ -545,6 +545,7 @@ Function Invoke-GiteaFileDownload {
|
||||
}
|
||||
}
|
||||
else {
|
||||
$result.Result = 'Skipped'
|
||||
$errorMsg = "The file '$fileOutputPath' already exists. Use the -Force switch to overwrite the file."
|
||||
Write-Error $errorMsg
|
||||
$result.Error = $errorMsg
|
||||
@@ -578,6 +579,7 @@ Function Invoke-GiteaFileDownload {
|
||||
return $result
|
||||
}
|
||||
catch {
|
||||
$result.Result = 'Failure'
|
||||
$errorMsg = "Failed to download file from Gitea: $_"
|
||||
Write-Error $errorMsg
|
||||
$result.Error = $errorMsg
|
||||
|
||||
Reference in New Issue
Block a user