Add template multiply test
This commit is contained in:
1 parent
7805d2800c
commit
9f5f13644a
2 files changed
+14
-1
No files matched your search
@@ -84,6 +84,19 @@ class TestUtilTemplate(unittest.TestCase):
|
||||
'{{ "no_number" | round }}'
|
||||
))
|
||||
|
||||
def test_multiply(self):
|
||||
tests = {
|
||||
None: 'None',
|
||||
10: '100',
|
||||
'"abcd"': 'abcd'
|
||||
}
|
||||
|
||||
for inp, out in tests.items():
|
||||
self.assertEqual(
|
||||
out,
|
||||
template.render(self.hass,
|
||||
'{{ %s | multiply(10) | round }}' % inp))
|
||||
|
||||
def test_passing_vars_as_keywords(self):
|
||||
self.assertEqual(
|
||||
'127', template.render(self.hass, '{{ hello }}', hello=127))
|
||||
|
||||
Reference in new issue
Block a user