mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-16 01:45:25 -07:00
Ansible.Basic.cs - fix check mode run with nested spec (#48838)
This commit is contained in:
parent
a41c0405a7
commit
fd4b282f6f
2 changed files with 24 additions and 1 deletions
|
@ -1352,6 +1352,28 @@ test_no_log - Invoked with:
|
|||
$actual.invocation | Assert-DictionaryEquals -Expected @{module_args = @{option_key = "abc"}}
|
||||
}
|
||||
|
||||
"Check mode with suboption without supports_check_mode" = {
|
||||
$spec = @{
|
||||
options = @{
|
||||
sub_options = @{
|
||||
# This tests the situation where a sub key doesn't set supports_check_mode, the logic in
|
||||
# Ansible.Basic automatically sets that to $false and we want it to ignore it for a nested check
|
||||
type = "dict"
|
||||
options = @{
|
||||
sub_option = @{ type = "str"; default = "value" }
|
||||
}
|
||||
}
|
||||
}
|
||||
supports_check_mode = $true
|
||||
}
|
||||
$complex_args = @{
|
||||
_ansible_check_mode = $true
|
||||
}
|
||||
|
||||
$m = [Ansible.Basic.AnsibleModule]::Create(@(), $spec)
|
||||
$m.CheckMode | Assert-Equals -Expected $true
|
||||
}
|
||||
|
||||
"Type conversion error" = {
|
||||
$spec = @{
|
||||
options = @{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue