Esempio n. 1
0
 def test_lowYear(self):
     date = datetime.date.today() - datetime.timedelta(weeks=80)
     if self.printing:
         print(date)
     self.assertEqual(
         parseDate(
             str(date.day) + '.' + str(date.month) + '.' + str(date.year)),
         str(date.year) + '-' + str(date.month) + '-' + str(date.day))
Esempio n. 2
0
 def test_Now(self):
     date = datetime.date.today()
     if self.printing:
         print(date)
     self.assertEqual(
         parseDate(
             str(date.day) + '.' + str(date.month) + '.' + str(date.year)),
         str(date.year) + '-' + str(date.month) + '-' + str(date.day))
Esempio n. 3
0
 def test_bigDay(self):
     date = datetime.date.today() + datetime.timedelta(days=1)
     if self.printing:
         print(date)
     self.assertEqual(
         parseDate(
             str(date.day) + '.' + str(date.month) + '.' + str(date.year)),
         None)
Esempio n. 4
0
 def test_badStriing(self):
     i = 1
     if self.printing:
         print(self.tests[i][2])
     self.assertEqual(parseDate(self.tests[i][0]), self.tests[i][1],
                      self.tests[i][2])
Esempio n. 5
0
 def test_goodDate(self):
     i = 0
     if self.printing:
         print(self.tests[i][2])
     self.assertEqual(parseDate(self.tests[i][0]), self.tests[i][1],
                      self.tests[i][2])