Exemplo n.º 1
0
 def test_extract_datetime_works_as_expected_for_given_datetime_string(
         self):
     result = DateTimeFormatter.extract_datetime("2012-12-24 16:17:18",
                                                 timezone="Europe/Berlin")
     self.assertEqual(result.year, 2012)
     self.assertEqual(result.month, 12)
     self.assertEqual(result.day, 24)
     self.assertEqual(result.hour, 16)
     self.assertEqual(result.minute, 17)
     self.assertEqual(result.second, 18)
Exemplo n.º 2
0
 def test_extract_datetime_rejects_invalid_datetime(self):
     with self.assertRaises(PolyaxonDateTimeFormatterException):
         DateTimeFormatter.extract_datetime("foo", timezone="Europe/Berlin")
Exemplo n.º 3
0
 def test_extract_datetime_accepts_raises_for_none(self):
     with self.assertRaises(PolyaxonDateTimeFormatterException):
         DateTimeFormatter.extract_datetime(None, timezone="Europe/Berlin")