From 2aea8a63688f4421875ae8f1d2a2839c52fe1659 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Fri, 23 Aug 2013 12:29:38 +0200 Subject: [PATCH] add a test to verify ansible detect invalid range --- test/TestInventory.py | 3 +++ test/inventory/test_incorrect_range | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 test/inventory/test_incorrect_range diff --git a/test/TestInventory.py b/test/TestInventory.py index d269544c9a..7e442716dd 100644 --- a/test/TestInventory.py +++ b/test/TestInventory.py @@ -270,6 +270,9 @@ class TestInventory(unittest.TestCase): hosts = inventory.list_hosts("nc:&triangle:!tri_c") self.compare(hosts, ['tri_a', 'tri_b']) + @raises(errors.AnsibleError) + def test_invalid_range(self): + Inventory(os.path.join(self.test_dir, 'inventory','test_incorrect_range')) ################################################### ### Inventory API tests diff --git a/test/inventory/test_incorrect_range b/test/inventory/test_incorrect_range new file mode 100644 index 0000000000..272ca7be71 --- /dev/null +++ b/test/inventory/test_incorrect_range @@ -0,0 +1,2 @@ +[test] +host[1:2:3:4]