From 6ad09f18255fe8af8b74b4a3a38fe759fab58beb Mon Sep 17 00:00:00 2001 From: Dan Slimmon Date: Thu, 10 Jul 2014 00:21:38 +0000 Subject: [PATCH] Added test for regex grouping bug fixed in 307a3e --- test/units/TestInventory.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/units/TestInventory.py b/test/units/TestInventory.py index e8f85adbd4..65da05dba3 100644 --- a/test/units/TestInventory.py +++ b/test/units/TestInventory.py @@ -274,6 +274,14 @@ class TestInventory(unittest.TestCase): print "EXPECTED=%s" % 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):