mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Revising method for parsing ranges from --limit subsets
Also added a new test (test_subset_range) for future validation. Fixes #4620
This commit is contained in:
@@ -206,6 +206,11 @@ class TestInventory(unittest.TestCase):
|
||||
inventory.subset('odin;thor,loki')
|
||||
self.assertEqual(sorted(inventory.list_hosts()), sorted(['thor','odin','loki']))
|
||||
|
||||
def test_subset_range(self):
|
||||
inventory = self.simple_inventory()
|
||||
inventory.subset('greek[0-2];norse[0]')
|
||||
self.assertEqual(sorted(inventory.list_hosts()), sorted(['zeus','hera','thor']))
|
||||
|
||||
def test_subset_filename(self):
|
||||
inventory = self.simple_inventory()
|
||||
inventory.subset('@' + os.path.join(self.test_dir, 'restrict_pattern'))
|
||||
|
||||
Reference in New Issue
Block a user