mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
J2 test docs (#16646)
* moved tests from filters to actual jinja2 tests also removed some unused declarations and imports * split tests into their own docs removed isnan as existing jinja2's 'number' already covers same added missing docs for several tests * updated as per feedback
This commit is contained in:
@@ -18,12 +18,20 @@
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import math
|
||||
|
||||
def issubset(a, b):
|
||||
return set(a) <= set(b)
|
||||
|
||||
def issuperset(a, b):
|
||||
return set(a) >= set(b)
|
||||
|
||||
def isnotanumber(x):
|
||||
try:
|
||||
return math.isnan(x)
|
||||
except TypeError:
|
||||
return False
|
||||
|
||||
class TestModule:
|
||||
''' Ansible math jinja2 tests '''
|
||||
|
||||
@@ -32,4 +40,5 @@ class TestModule:
|
||||
# set theory
|
||||
'issubset': issubset,
|
||||
'issuperset': issuperset,
|
||||
'isnan': isnotanumber,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user