Пример #1
0
 def test_tobohour_transforms_datetime_into_the_time_of_beginning_of_hour(
         self):
     d = SuperDateTime(dtbh=datetime(2021, 10, 11, 17, 37, 27))
     self.assertEqual(d.dtbh, datetime(2021, 10, 11, 17, 0))
Пример #2
0
 def test_tobosec_transforms_datetime_into_the_time_of_beginning_of_second(
         self):
     d = SuperDateTime(dtbs=datetime(2021, 10, 11, 17, 37, 27, 446259))
     self.assertEqual(d.dtbs, datetime(2021, 10, 11, 17, 37, 27))
Пример #3
0
 def test_tobosec_does_not_transform_if_is_not_datetime(self):
     s = SuperDateTime(stbs="12345")
     self.assertEqual(s.stbs, "12345")
Пример #4
0
 def test_tonextday_transforms_datetime_into_the_time_of_next_day(self):
     d = SuperDateTime(dtnd=datetime(2021, 10, 11, 17, 37, 27, 446259))
     self.assertEqual(d.dtnd, datetime(2021,10, 12, 0, 0))
Пример #5
0
 def test_tonextday_transforms_date_into_the_time_of_next_day(self):
     d = SuperDateTime(dnd=date(2021, 10, 11))
     self.assertEqual(d.dnd, date(2021,10, 12))
Пример #6
0
 def test_tobomin_transforms_datetime_into_the_time_of_beginning_of_minute(
         self):
     d = SuperDateTime(dtbm=datetime(2021, 10, 11, 17, 37, 27))
     self.assertEqual(d.dtbm, datetime(2021, 10, 11, 17, 37))