Beispiel #1
0
 def test_compare_dates_pass_2(self):
     d1, d2 = 'Feb 12 2010', 'Feb 13 2010'
     tol = 3
     tested = MatchBlock.compare_dates(d1,
                                       d2,
                                       tolerance=tol,
                                       pattern='%b %d %Y')
     self.assertEqual(tested, True)
Beispiel #2
0
 def test_compare_dates_fail_3(self):
     d1 = [
         datetime.date.today(),
         datetime.date.today() - datetime.timedelta(1)
     ]
     d2 = [
         datetime.date.today(),
         datetime.date.today() - datetime.timedelta(3)
     ]
     tol = 0
     tested = MatchBlock.compare_dates(d1, d2, tolerance=tol)
     self.assertIs(tested, False)
Beispiel #3
0
 def test_compare_dates_pass_5(self):
     d1 = [
         datetime.date.today(),
         datetime.date.today() - datetime.timedelta(3)
     ]
     d2 = [
         datetime.date.today() + datetime.timedelta(1),
         datetime.date.today() - datetime.timedelta(2)
     ]
     tol = 1
     tested = MatchBlock.compare_dates(d1, d2, tolerance=tol)
     self.assertIs(tested, True)
Beispiel #4
0
 def test_compare_dates_fail_1(self):
     d1, d2 = '12-Feb-2015', '15-Feb-2015'
     tol = 2
     tested = MatchBlock.compare_dates(d1, d2, tolerance=tol)
     self.assertIs(tested, False)
Beispiel #5
0
 def test_compare_dates_pass_3(self):
     d1, d2 = datetime.date.today(), datetime.date.today()
     tol = 3
     tested = MatchBlock.compare_dates(d1, d2, tolerance=tol)
     self.assertIs(tested, True)
Beispiel #6
0
 def test_compare_dates_pass_1(self):
     d1, d2 = '12-Feb-2015', '14-Feb-2015'
     tol = 2
     tested = MatchBlock.compare_dates(d1, d2, tolerance=tol)
     self.assertIs(tested, True)