mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Ansible.ModuleUtils.FileUtil: catch DirectoryNotFoundException when testing a path (#37968)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user