Beispiel #1
0
 def testOnSaturdayAfter8pm(self):
     input_date = datetime.datetime(2018,
                                    9,
                                    15,
                                    21,
                                    0,
                                    0,
                                    tzinfo=dateutil.tz.tzutc())
     self.assertEqual(nextDrawDate(input_date),
                      datetime.datetime(2018, 9, 19, 20, 0, 0))
Beispiel #2
0
 def testOnWednesdayBefore8pm(self):
     input_date = datetime.datetime(2018,
                                    9,
                                    12,
                                    19,
                                    0,
                                    0,
                                    tzinfo=dateutil.tz.tzutc())
     self.assertEqual(nextDrawDate(input_date),
                      datetime.datetime(2018, 9, 12, 20, 0, 0))
Beispiel #3
0
 def testWithCurrentDate(self):
     self.assertGreaterEqual(nextDrawDate(), datetime.datetime.utcnow())
Beispiel #4
0
 def testForWrongDateFormat(self):
     input_date = "2018-9-15"
     self.assertEqual(nextDrawDate(input_date),
                      "input date format is not datetime type")
Beispiel #5
0
 def testOnWednesdayAfter8pm(self):
     input_date = datetime.datetime(2018, 9, 12, 21, 0, 0)
     self.assertEqual(nextDrawDate(input_date),
                      datetime.datetime(2018, 9, 15, 20, 0, 0))
Beispiel #6
0
 def testAfterSaturdayBeforeWednesday(self):
     input_date = datetime.datetime(2018, 9, 17, tzinfo=dateutil.tz.tzutc())
     self.assertEqual(nextDrawDate(input_date),
                      datetime.datetime(2018, 9, 19, 20, 0, 0))
Beispiel #7
0
 def testAfterWednesday(self):
     input_date = datetime.datetime(2018, 9, 13, tzinfo=dateutil.tz.tzutc())
     self.assertEqual(nextDrawDate(input_date),
                      datetime.datetime(2018, 9, 15, 20, 0, 0))