mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Merge branch 'regexreplace' of git://github.com/jacobweber/ansible into jacobweber-regexreplace
This commit is contained in:
commit
efba8b4771
2 changed files with 25 additions and 0 deletions
|
@ -116,6 +116,21 @@ class TestFilters(unittest.TestCase):
|
|||
True)
|
||||
assert a == True
|
||||
|
||||
def test_regex_replace_case_sensitive(self):
|
||||
a = ansible.runner.filter_plugins.core.regex_replace('ansible', '^a.*i(.*)$',
|
||||
'a\\1')
|
||||
assert a == 'able'
|
||||
|
||||
def test_regex_replace_case_insensitive(self):
|
||||
a = ansible.runner.filter_plugins.core.regex_replace('ansible', '^A.*I(.*)$',
|
||||
'a\\1', True)
|
||||
assert a == 'able'
|
||||
|
||||
def test_regex_replace_no_match(self):
|
||||
a = ansible.runner.filter_plugins.core.regex_replace('ansible', '^b.*i(.*)$',
|
||||
'a\\1')
|
||||
assert a == 'ansible'
|
||||
|
||||
#def test_filters(self):
|
||||
|
||||
# this test is pretty low level using a playbook, hence I am disabling it for now -- MPD.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue