Skip to content

Commit

Permalink
Commit conflic
Browse files Browse the repository at this point in the history
  • Loading branch information
Gijsreyn committed Nov 15, 2024
1 parent b371c1e commit 041076a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/PythonPip3Dsc/PythonPip3Dsc.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -108,26 +108,33 @@ Describe 'Pip3Package' {
$whatIfState = @{
PackageName = 'itsdangerous'
Version = '2.2.0'
Exist = $false
}

$pipPackage = [Pip3Package]$whatIfState

# Uninstall to make sure it is not present
$pipPackage.Set()

$pipPackage.Exist = $true

# Call whatif to see if it "will" install
$whatIf = $pipPackage.WhatIf() | ConvertFrom-Json


$whatIf.PackageName | Should -Be 'itsdangerous'
$whatIf._metaData.whatIf | Should -Contain "Would install itsdangerous-$($whatIfState.Version)"
}

It 'Does not return whatif result if package is invalid' -Skip:(!$IsWindows) {
$whatIfState = @{
PackageName = 'itsdangerouss'
PackageName = 'invalidPackageName'
}

$pipPackage = [Pip3Package]$whatIfState
$whatIf = $pipPackage.WhatIf() | ConvertFrom-Json


$whatIf.PackageName | Should -Be 'itsdangerouss'

$whatIf.PackageName | Should -Be 'invalidPackageName'
$whatIf._metaData.whatIf | Should -Contain "ERROR: No matching distribution found for $($whatIfState.PackageName)"
}
}

0 comments on commit 041076a

Please sign in to comment.