mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-30 14:21:26 -07:00
adding min() and max() filters for use in Jinja templates
This commit is contained in:
parent
2d2178f2c5
commit
3ba516ac25
3 changed files with 32 additions and 0 deletions
|
@ -175,3 +175,11 @@ class TestFilters(unittest.TestCase):
|
|||
self.assertTrue(ansible.runner.filter_plugins.core.version_compare(1.0, 1.1, '<='))
|
||||
|
||||
self.assertTrue(ansible.runner.filter_plugins.core.version_compare('12.04', 12, 'ge'))
|
||||
|
||||
def test_min(self):
|
||||
a = ansible.runner.filter_plugins.core.min([3, 2, 5, 4])
|
||||
assert a == 2
|
||||
|
||||
def test_max(self):
|
||||
a = ansible.runner.filter_plugins.core.max([3, 2, 5, 4])
|
||||
assert a == 5
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue