mirror of
https://github.com/zebrajr/ansible.git
synced 2025-12-06 12:19:53 +01:00
Fix Typo in Variable Name and Update Test Data for Identifier Validation (#85338)
This commit is contained in:
parent
f6be5ab224
commit
778fdcbef1
|
|
@ -114,7 +114,7 @@ $actual = Run-Command -command "cmd.exe /c set" -environment @{ TESTENV2 = "test
|
||||||
$env_not_present = $actual.stdout -split "`r`n" | Where-Object { $_ -eq "TESTENV=test" }
|
$env_not_present = $actual.stdout -split "`r`n" | Where-Object { $_ -eq "TESTENV=test" }
|
||||||
$env_present = $actual.stdout -split "`r`n" | Where-Object { $_ -eq "TESTENV2=testing" }
|
$env_present = $actual.stdout -split "`r`n" | Where-Object { $_ -eq "TESTENV2=testing" }
|
||||||
if ($null -ne $env_not_present) {
|
if ($null -ne $env_not_present) {
|
||||||
Fail-Json -obj $result -message "Test $test_name failed`nenvironment variabel TESTENV found in stdout when it should be`n$($actual.stdout)"
|
Fail-Json -obj $result -message "Test $test_name failed`nenvironment variable TESTENV found in stdout when it should be`n$($actual.stdout)"
|
||||||
}
|
}
|
||||||
if ($null -eq $env_present) {
|
if ($null -eq $env_present) {
|
||||||
Fail-json -obj $result -message "Test $test_name failed`nenvironment variable TESTENV2 not found in stdout`n$($actual.stdout)"
|
Fail-json -obj $result -message "Test $test_name failed`nenvironment variable TESTENV2 not found in stdout`n$($actual.stdout)"
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@ class TestBase(unittest.TestCase):
|
||||||
def test_vars_not_valid_identifier(self):
|
def test_vars_not_valid_identifier(self):
|
||||||
ds = {'environment': [],
|
ds = {'environment': [],
|
||||||
'vars': [{'var_2_key': 'var_2_value'},
|
'vars': [{'var_2_key': 'var_2_value'},
|
||||||
{'1an-invalid identifer': 'var_1_value'}]
|
{'1an-invalid identifier': 'var_1_value'}]
|
||||||
}
|
}
|
||||||
self.assertRaises(AnsibleParserError, self.b.load_data, ds)
|
self.assertRaises(AnsibleParserError, self.b.load_data, ds)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user