Esempio n. 1
0
 def test_invalid(self):
     '''Raises an error on an unparseable date.'''
     with self.assertRaises(ValueError):
         util.parse_date('Not a real date')
Esempio n. 2
0
 def test_rfc_850(self):
     '''An obsolete date format that is also supported.'''
     self.assertEqual(
         util.parse_date('Sunday, 06-Nov-94 08:49:37 GMT'), 784111777)
Esempio n. 3
0
 def test_asctime(self):
     '''An obsolete date format that is also supported.'''
     self.assertEqual(
         util.parse_date('Sun Nov  6 08:49:37 1994'), 784111777)
Esempio n. 4
0
 def test_imf_fixdate(self):
     '''Successfully parses a IMF fixdate.'''
     self.assertEqual(
         util.parse_date('Sun, 06 Nov 1994 08:49:37 GMT'), 784111777)
Esempio n. 5
0
 def test_invalid(self):
     '''Raises an error on an unparseable date.'''
     with self.assertRaises(ValueError):
         util.parse_date('Not a real date')
Esempio n. 6
0
 def test_asctime(self):
     '''An obsolete date format that is also supported.'''
     self.assertEqual(util.parse_date('Sun Nov  6 08:49:37 1994'),
                      784111777)
Esempio n. 7
0
 def test_rfc_850(self):
     '''An obsolete date format that is also supported.'''
     self.assertEqual(util.parse_date('Sunday, 06-Nov-94 08:49:37 GMT'),
                      784111777)
Esempio n. 8
0
 def test_imf_fixdate(self):
     '''Successfully parses a IMF fixdate.'''
     self.assertEqual(util.parse_date('Sun, 06 Nov 1994 08:49:37 GMT'),
                      784111777)