diff options
author | Sam Doran <sdoran@redhat.com> | 2019-09-20 22:03:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-20 22:03:51 +0200 |
commit | 987265a6ef920466b44625097ff85f3e845dc8ea (patch) | |
tree | de0ee35897219f38e25190a59e57b267a7110fd4 /test/units/plugins | |
parent | allow before/after diff to be NoneType (#62582) (diff) | |
download | ansible-987265a6ef920466b44625097ff85f3e845dc8ea.tar.xz ansible-987265a6ef920466b44625097ff85f3e845dc8ea.zip |
Account for empty strings when splitting the host pattern (#62442)
Improve tests
- add more unit test cases
- add specific integration test with more cases
Testing shows no major downside to calling .strip() twice in a comprehension vs. using a regular for loop and only calling .strip() once. Going with the comprehension for ease of maintenance and because comprehensions are optimized in CPython.
Diffstat (limited to 'test/units/plugins')
-rw-r--r-- | test/units/plugins/inventory/test_inventory.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/units/plugins/inventory/test_inventory.py b/test/units/plugins/inventory/test_inventory.py index 48c3f9834a..66b5ec3787 100644 --- a/test/units/plugins/inventory/test_inventory.py +++ b/test/units/plugins/inventory/test_inventory.py @@ -49,6 +49,10 @@ class TestInventory(unittest.TestCase): 'a:b': ['a', 'b'], ' a : b ': ['a', 'b'], 'foo:bar:baz[1:2]': ['foo', 'bar', 'baz[1:2]'], + 'a,,b': ['a', 'b'], + 'a, ,b,,c, ,': ['a', 'b', 'c'], + ',': [], + '': [], } pattern_lists = [ |