mirror of
https://github.com/ansible/awx.git
synced 2026-03-20 02:17:37 -02:30
Extend unit test for Azure source variable generation
Add tests for generation of Azure source variables. Test cases such as overwriting a variable with its default value, overwriting a variable with something different to its default value and add variables not set by default.
This commit is contained in:
@@ -1879,6 +1879,10 @@ class TestInventoryUpdateCredentials(TestJobExecution):
|
|||||||
)
|
)
|
||||||
return cred
|
return cred
|
||||||
self.instance.get_cloud_credential = get_cred
|
self.instance.get_cloud_credential = get_cred
|
||||||
|
self.instance.source_vars = {
|
||||||
|
'include_powerstate': 'yes',
|
||||||
|
'group_by_resource_group': 'no'
|
||||||
|
}
|
||||||
|
|
||||||
def run_pexpect_side_effect(*args, **kwargs):
|
def run_pexpect_side_effect(*args, **kwargs):
|
||||||
args, cwd, env, stdout = args
|
args, cwd, env, stdout = args
|
||||||
@@ -1891,8 +1895,9 @@ class TestInventoryUpdateCredentials(TestJobExecution):
|
|||||||
config = ConfigParser.ConfigParser()
|
config = ConfigParser.ConfigParser()
|
||||||
config.read(env['AZURE_INI_PATH'])
|
config.read(env['AZURE_INI_PATH'])
|
||||||
assert config.get('azure', 'include_powerstate') == 'yes'
|
assert config.get('azure', 'include_powerstate') == 'yes'
|
||||||
assert config.get('azure', 'group_by_resource_group') == 'yes'
|
assert config.get('azure', 'group_by_resource_group') == 'no'
|
||||||
assert config.get('azure', 'group_by_location') == 'yes'
|
assert config.get('azure', 'group_by_location') == 'yes'
|
||||||
|
assert 'group_by_security_group' not in config.items('azure')
|
||||||
assert config.get('azure', 'group_by_tag') == 'yes'
|
assert config.get('azure', 'group_by_tag') == 'yes'
|
||||||
assert config.get('azure', 'locations') == 'north,south,east,west'
|
assert config.get('azure', 'locations') == 'north,south,east,west'
|
||||||
return ['successful', 0]
|
return ['successful', 0]
|
||||||
@@ -1919,6 +1924,11 @@ class TestInventoryUpdateCredentials(TestJobExecution):
|
|||||||
)
|
)
|
||||||
return cred
|
return cred
|
||||||
self.instance.get_cloud_credential = get_cred
|
self.instance.get_cloud_credential = get_cred
|
||||||
|
self.instance.source_vars = {
|
||||||
|
'include_powerstate': 'yes',
|
||||||
|
'group_by_resource_group': 'no',
|
||||||
|
'group_by_security_group': 'no'
|
||||||
|
}
|
||||||
|
|
||||||
def run_pexpect_side_effect(*args, **kwargs):
|
def run_pexpect_side_effect(*args, **kwargs):
|
||||||
args, cwd, env, stdout = args
|
args, cwd, env, stdout = args
|
||||||
@@ -1930,8 +1940,9 @@ class TestInventoryUpdateCredentials(TestJobExecution):
|
|||||||
config = ConfigParser.ConfigParser()
|
config = ConfigParser.ConfigParser()
|
||||||
config.read(env['AZURE_INI_PATH'])
|
config.read(env['AZURE_INI_PATH'])
|
||||||
assert config.get('azure', 'include_powerstate') == 'yes'
|
assert config.get('azure', 'include_powerstate') == 'yes'
|
||||||
assert config.get('azure', 'group_by_resource_group') == 'yes'
|
assert config.get('azure', 'group_by_resource_group') == 'no'
|
||||||
assert config.get('azure', 'group_by_location') == 'yes'
|
assert config.get('azure', 'group_by_location') == 'yes'
|
||||||
|
assert config.get('azure', 'group_by_security_group') == 'no'
|
||||||
assert config.get('azure', 'group_by_tag') == 'yes'
|
assert config.get('azure', 'group_by_tag') == 'yes'
|
||||||
assert 'locations' not in config.items('azure')
|
assert 'locations' not in config.items('azure')
|
||||||
return ['successful', 0]
|
return ['successful', 0]
|
||||||
|
|||||||
Reference in New Issue
Block a user