mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Added test for regex grouping bug fixed in 307a3e
This commit is contained in:
parent
307a3e8a9c
commit
6ad09f1825
1 changed files with 8 additions and 0 deletions
|
@ -274,6 +274,14 @@ class TestInventory(unittest.TestCase):
|
||||||
print "EXPECTED=%s" % sorted(expected_hosts)
|
print "EXPECTED=%s" % sorted(expected_hosts)
|
||||||
assert sorted(hosts) == sorted(expected_hosts)
|
assert sorted(hosts) == sorted(expected_hosts)
|
||||||
|
|
||||||
|
def test_regex_grouping(self):
|
||||||
|
inventory = self.simple_inventory()
|
||||||
|
hosts = inventory.list_hosts("~(cer[a-z]|berc)(erus00[13])")
|
||||||
|
expected_hosts = ['cerberus001', 'cerberus003']
|
||||||
|
print "HOSTS=%s" % sorted(hosts)
|
||||||
|
print "EXPECTED=%s" % sorted(expected_hosts)
|
||||||
|
assert sorted(hosts) == sorted(expected_hosts)
|
||||||
|
|
||||||
def test_complex_enumeration(self):
|
def test_complex_enumeration(self):
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue