Use assertEqual in test_strptime for better failure messages (cf. issue #14113).

This commit is contained in:
Nadeem Vawda 2012-02-25 15:58:36 +02:00
parent 9a2d99e28a
commit afdac030e3
1 changed files with 6 additions and 9 deletions

View File

@ -86,17 +86,14 @@ class LocaleTime_Tests(unittest.TestCase):
# output.
magic_date = (1999, 3, 17, 22, 44, 55, 2, 76, 0)
strftime_output = time.strftime("%c", magic_date)
self.assertTrue(strftime_output == time.strftime(self.LT_ins.LC_date_time,
magic_date),
"LC_date_time incorrect")
self.assertEqual(time.strftime(self.LT_ins.LC_date_time, magic_date),
strftime_output, "LC_date_time incorrect")
strftime_output = time.strftime("%x", magic_date)
self.assertTrue(strftime_output == time.strftime(self.LT_ins.LC_date,
magic_date),
"LC_date incorrect")
self.assertEqual(time.strftime(self.LT_ins.LC_date, magic_date),
strftime_output, "LC_date incorrect")
strftime_output = time.strftime("%X", magic_date)
self.assertTrue(strftime_output == time.strftime(self.LT_ins.LC_time,
magic_date),
"LC_time incorrect")
self.assertEqual(time.strftime(self.LT_ins.LC_time, magic_date),
strftime_output, "LC_time incorrect")
LT = _strptime.LocaleTime()
LT.am_pm = ('', '')
self.assertTrue(LT.LC_time, "LocaleTime's LC directives cannot handle "