Issue #11330: Added regression test.

This commit is contained in:
Vinay Sajip 2011-02-26 16:00:04 +00:00
parent d20a5f6161
commit 4a7f2168a6
1 changed files with 8 additions and 0 deletions

View File

@ -1907,6 +1907,8 @@ class FormatterTest(unittest.TestCase):
self.assertFalse(f.usesTime())
f = logging.Formatter('%(asctime)s')
self.assertTrue(f.usesTime())
f = logging.Formatter('%(asctime)-15s')
self.assertTrue(f.usesTime())
f = logging.Formatter('asctime')
self.assertFalse(f.usesTime())
@ -1920,6 +1922,10 @@ class FormatterTest(unittest.TestCase):
self.assertFalse(f.usesTime())
f = logging.Formatter('{asctime}', style='{')
self.assertTrue(f.usesTime())
f = logging.Formatter('{asctime!s:15}', style='{')
self.assertTrue(f.usesTime())
f = logging.Formatter('{asctime:15}', style='{')
self.assertTrue(f.usesTime())
f = logging.Formatter('asctime', style='{')
self.assertFalse(f.usesTime())
@ -1935,6 +1941,8 @@ class FormatterTest(unittest.TestCase):
self.assertFalse(f.usesTime())
f = logging.Formatter('${asctime}', style='$')
self.assertTrue(f.usesTime())
f = logging.Formatter('${asctime', style='$')
self.assertFalse(f.usesTime())
f = logging.Formatter('$asctime', style='$')
self.assertTrue(f.usesTime())
f = logging.Formatter('asctime', style='$')