summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Salgado <vms@pinhaotec.com.br>2015-09-17 13:50:40 -0300
committerVictor Salgado <vms@pinhaotec.com.br>2015-09-17 13:50:40 -0300
commit01ae60d5240370359e97a8a79759a3c80eea46a0 (patch)
treef32a3431515bdda35e430093283acaf871dd9f63
parent349eec7855549ca2c458c222ae10406193a25cae (diff)
downloadansible-01ae60d5240370359e97a8a79759a3c80eea46a0.tar.gz
Add more tests for _split_pattern for when the input is a list
-rw-r--r--test/units/inventory/test_inventory.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/units/inventory/test_inventory.py b/test/units/inventory/test_inventory.py
index 3869e15b58..e397143390 100644
--- a/test/units/inventory/test_inventory.py
+++ b/test/units/inventory/test_inventory.py
@@ -44,6 +44,14 @@ class TestInventory(unittest.TestCase):
' a : b ': ['a', 'b'],
'foo:bar:baz[1:2]': ['foo', 'bar', 'baz[1:2]'],
}
+ pattern_lists = [
+ [['a'], ['a']],
+ [['a', 'b'], ['a', 'b']],
+ [['a, b'], ['a', 'b']],
+ [['9a01:7f8:191:7701::9', '9a01:7f8:191:7701::9,foo'],
+ ['9a01:7f8:191:7701::9', '9a01:7f8:191:7701::9','foo']]
+ ]
+
def setUp(self):
v = VariableManager()
@@ -56,3 +64,6 @@ class TestInventory(unittest.TestCase):
for p in self.patterns:
r = self.patterns[p]
self.assertEqual(r, self.i._split_pattern(p))
+
+ for p, r in self.pattern_lists:
+ self.assertEqual(r, self.i._split_pattern(p))