コード例 #1
0
 def test__cast_date_time_HH_mm_ss(self):
     time_str = "13:04:08"
     date_str = "1900-01-01 " + time_str
     exp = datetime.datetime.strptime(date_str, "%Y-%m-%d %H:%M:%S")
     obs = xvb._cast_date_time(time_str, xvb.datetime_formats)
     self.assertEqual(exp, obs)
コード例 #2
0
 def test__cast_date_time_YYYY_MM_DD(self):
     input_str = "2008-12-03"
     exp = datetime.datetime.strptime(input_str, "%Y-%m-%d")
     obs = xvb._cast_date_time(input_str, xvb.datetime_formats)
     self.assertEqual(exp, obs)
コード例 #3
0
 def test__cast_date_time_YYYY_MM_DD_HH_mm_ss(self):
     input_str = "2008-12-03 13:04:08"
     exp = datetime.datetime.strptime(input_str, "%Y-%m-%d %H:%M:%S")
     obs = xvb._cast_date_time(input_str, xvb.datetime_formats)
     self.assertEqual(exp, obs)
コード例 #4
0
 def test__cast_date_time_YYYY(self):
     input_str = "2008"
     exp = datetime.datetime.strptime(input_str, "%Y")
     obs = xvb._cast_date_time(input_str, xvb.datetime_formats)
     self.assertEqual(exp, obs)