Merge branch 'regexreplace' of git://github.com/jacobweber/ansible into jacobweber-regexreplace

This commit is contained in:
James Tanner 2014-03-31 13:48:13 -04:00
commit efba8b4771
2 changed files with 25 additions and 0 deletions

View file

@ -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.