Fixes tests that use AnsibleUndefined (#383)
* Fixes tests that use AnsibleUndefined * add change log * add same for other casespull/384/head
parent
46a3d71fb8
commit
dda46ee3cf
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
trivial:
|
||||
- Fixes test cases where there were assertion failure due to AnsibleUndefined path being changed.
|
|
@ -70,7 +70,8 @@ class TestIpFilter(TestCase):
|
|||
args = ["", AnsibleUndefined(name="my_ip"), ""]
|
||||
with pytest.raises(
|
||||
AnsibleFilterError,
|
||||
match="Unrecognized type <<class 'ansible.template.AnsibleUndefined'>> for ipaddr filter <value>",
|
||||
# Note: this class has been moved to native_helpers dir since 2.16, hence adding regex to be backwards compatable with 2.15
|
||||
match=r"Unrecognized type <<class 'ansible\.template\.(native_helpers\.)?AnsibleUndefined'>> for ipaddr filter <value>",
|
||||
):
|
||||
_ipaddr(*args)
|
||||
|
||||
|
|
|
@ -50,7 +50,8 @@ class TestIp4(TestCase):
|
|||
args = ["", AnsibleUndefined(name="my_ip"), ""]
|
||||
with pytest.raises(
|
||||
AnsibleFilterError,
|
||||
match="Unrecognized type <<class 'ansible.template.AnsibleUndefined'>> for ipv4 filter <value>",
|
||||
# Note: this class has been moved to native_helpers dir since 2.16, hence adding regex to be backwards compatable with 2.15
|
||||
match=r"Unrecognized type <<class 'ansible\.template\.(native_helpers\.)?AnsibleUndefined'>> for ipv4 filter <value>",
|
||||
):
|
||||
_ipv4(*args)
|
||||
|
||||
|
|
|
@ -53,7 +53,8 @@ class TestIp6(TestCase):
|
|||
args = ["", AnsibleUndefined(name="my_ip"), ""]
|
||||
with pytest.raises(
|
||||
AnsibleFilterError,
|
||||
match="Unrecognized type <<class 'ansible.template.AnsibleUndefined'>> for ipv6 filter <value>",
|
||||
# Note: this class has been moved to native_helpers dir since 2.16, hence adding regex to be backwards compatable with 2.15
|
||||
match=r"Unrecognized type <<class 'ansible\.template\.(native_helpers\.)?AnsibleUndefined'>> for ipv6 filter <value>",
|
||||
):
|
||||
_ipv6(*args)
|
||||
|
||||
|
|
|
@ -55,7 +55,8 @@ class TestIpWrap(TestCase):
|
|||
args = ["", AnsibleUndefined(name="my_ip"), ""]
|
||||
with pytest.raises(
|
||||
AnsibleFilterError,
|
||||
match="Unrecognized type <<class 'ansible.template.AnsibleUndefined'>> for ipwrap filter <value>",
|
||||
# Note: this class has been moved to native_helpers dir since 2.16, hence adding regex to be backwards compatable with 2.15
|
||||
match=r"Unrecognized type <<class 'ansible\.template\.(native_helpers\.)?AnsibleUndefined'>> for ipwrap filter <value>",
|
||||
):
|
||||
_ipwrap(*args)
|
||||
|
||||
|
|
Loading…
Reference in New Issue