Beispiel #1
0
 def test_rfc2822_format_string(self):
     val = utils.random_name()
     self.assertEqual(utils.rfc2822_format(val), val)
Beispiel #2
0
 def test_rfc2822_format_string_timestamp(self):
     dt = datetime.datetime(1999, 12, 31, 23, 59, 59)
     tm = time.mktime(dt.timetuple())
     expected = "Sat, 01 Jan 2000 05:59:59 -0000"
     self.assertEqual(utils.rfc2822_format(tm), expected)
Beispiel #3
0
 def test_rfc2822_format_fail(self):
     now = {}
     fmtd = utils.rfc2822_format(now)
     self.assertEqual(fmtd, now)
Beispiel #4
0
 def test_rfc2822_format(self):
     dt = datetime.datetime(1999, 12, 31, 23, 59, 59)
     expected = "Sat, 01 Jan 2000 05:59:59 -0000"
     self.assertEqual(utils.rfc2822_format(dt), expected)
Beispiel #5
0
 def test_rfc2822_format_str(self):
     now = str(datetime.datetime.now())
     fmtd = utils.rfc2822_format(now)
     self.assertEqual(fmtd, now)
Beispiel #6
0
 def test_rfc2822_format(self):
     now = datetime.datetime.now()
     now_year = str(now.year)
     fmtd = utils.rfc2822_format(now)
     self.assertTrue(now_year in fmtd)
Beispiel #7
0
 def test_rfc2822_format_fail(self):
     now = {}
     fmtd = utils.rfc2822_format(now)
     self.assertEqual(fmtd, now)
Beispiel #8
0
 def test_rfc2822_format_str(self):
     now = str(datetime.datetime.now())
     fmtd = utils.rfc2822_format(now)
     self.assertEqual(fmtd, now)
Beispiel #9
0
 def test_rfc2822_format(self):
     now = datetime.datetime.now()
     now_year = str(now.year)
     fmtd = utils.rfc2822_format(now)
     self.assertTrue(now_year in fmtd)