mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Ansible.ModuleUtils.FileUtil: catch DirectoryNotFoundException when testing a path (#37968)
This commit is contained in:
parent
63da50e1d8
commit
68e44e082e
3 changed files with 22 additions and 1 deletions
|
@ -48,6 +48,14 @@ if ($pagefile) {
|
|||
$actual = Test-AnsiblePath -Path C:\fakefile
|
||||
Assert-Equals -actual $actual -expected $false
|
||||
|
||||
# Test-AnsiblePath Directory that doesn't exist
|
||||
$actual = Test-AnsiblePath -Path C:\fakedirectory
|
||||
Assert-Equals -actual $actual -expected $false
|
||||
|
||||
# Test-AnsiblePath file in non-existant directory
|
||||
$actual = Test-AnsiblePath -Path C:\fakedirectory\fakefile.txt
|
||||
Assert-Equals -actual $actual -expected $false
|
||||
|
||||
# Test-AnsiblePath Normal directory
|
||||
$actual = Test-AnsiblePath -Path C:\Windows
|
||||
Assert-Equals -actual $actual -expected $true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue