Refs #28502 -- Completed stringformat filter tests

This commit is contained in:
Srinivas Reddy Thatiparthy 2017-08-19 21:22:14 +02:00 committed by Claude Paroz
parent 6784383e93
commit a64f88f5be
1 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,11 @@ class FunctionTests(SimpleTestCase):
def test_format(self):
self.assertEqual(stringformat(1, '03d'), '001')
self.assertEqual(stringformat([1, None], 's'), '[1, None]')
self.assertEqual(stringformat({1, 2}, 's'), '{1, 2}')
self.assertEqual(stringformat({1: 2, 2: 3}, 's'), '{1: 2, 2: 3}')
def test_invalid(self):
self.assertEqual(stringformat(1, 'z'), '')
self.assertEqual(stringformat(object(), 'd'), '')
self.assertEqual(stringformat(None, 'd'), '')