Beispiel #1
0
 def test_extract_date_accepts_raises_for_none(self):
     with self.assertRaises(PolyaxonDateTimeFormatterException):
         DateTimeFormatter.extract_date(None, timezone="Europe/Berlin")
Beispiel #2
0
 def test_extract_datetime_rejects_invalid_date(self):
     with self.assertRaises(PolyaxonDateTimeFormatterException):
         DateTimeFormatter.extract_date("foo", timezone="Europe/Berlin")
Beispiel #3
0
 def test_extract_date_works_as_expected_for_given_date_string(self):
     result = DateTimeFormatter.extract_date("2012-12-24",
                                             timezone="Europe/Berlin")
     self.assertEqual(result.year, 2012)
     self.assertEqual(result.month, 12)
     self.assertEqual(result.day, 24)