示例#1
0
    def test_time_to_datetime_with_epochtime(self):
        dt1 = weekdays.time_to_datetime(time_in_seconds=time.time())
        dt1_details = (dt1.year, dt1.month, dt1.day)

        dt2 = datetime.now()
        dt2_details = (dt2.year, dt2.month, dt2.day)

        self.assertEqual(dt1_details, dt2_details)
示例#2
0
    def test_time_to_datetime_with_timestruct(self):
        dt1 = weekdays.time_to_datetime(time_struct=time.gmtime())
        dt1_details = (dt1.year, dt1.month, dt1.day)

        dt2 = datetime.now()
        dt2_details = (dt2.year, dt2.month, dt2.day)

        self.assertEqual(dt1_details, dt2_details)
示例#3
0
    def test_time_to_datetime_with_epochtime(self):
        dt1 = weekdays.time_to_datetime(time_in_seconds=time.time())
        dt1_details = (dt1.year, dt1.month, dt1.day)

        dt2 = datetime.now()
        dt2_details = (dt2.year, dt2.month, dt2.day)

        self.assertEqual(dt1_details, dt2_details)
示例#4
0
    def test_time_to_datetime_with_timestruct(self):
        dt1 = weekdays.time_to_datetime(time_struct=time.gmtime())
        dt1_details = (dt1.year, dt1.month, dt1.day)

        dt2 = datetime.now()
        dt2_details = (dt2.year, dt2.month, dt2.day)

        self.assertEqual(dt1_details, dt2_details)
示例#5
0
 def test_time_to_datetime_withexception(self):
     with self.assertRaises(Exception) as context:
         weekdays.time_to_datetime()
示例#6
0
 def test_time_to_datetime_withexception(self):
     with self.assertRaises(Exception) as context:
         weekdays.time_to_datetime()