示例#1
0
 def test_lib_cdate_Dayofweek(self):
     # this also validates cdate.julianDay, since Date.day_of_week depends on it
     for m in range(3, 6):
         for d in range(10, 20):
             realwd = datetime.date(2020, m, d).weekday()
             testwd = cdate.Date(2020, m, d).day_of_week
             self.assertEqual(
                 realwd,
                 testwd,
                 msg="Expected weekday to be %i for date 2020-%i-%i, got %i"
                 % (realwd, m, d, testwd))
示例#2
0
 def test_lib_cdate_DateCtor(self):
     cdate.Date(2014, 1, 31)
示例#3
0
    def test_lib_cdate_Julianday(self):
        bd = cdate.Date(2014, 1, 10)
        jd = cdate.julianDay(bd.year, bd.month, bd.day)

        self.assertTrue(jd == bd.julian,
                        msg='Expected them to be equal')