Пример #1
0
 def test_two_dates(self):
     start = date(2016, 1, 20)
     end = date(2016, 1, 21)
     date_list = [d for d in days(start, end)]
     self.assertEqual(len(date_list), 2)
     self.assertEqual(date_list[0], start)
     self.assertEqual(date_list[len(date_list)-1], end)
Пример #2
0
 def test_one_single_date(self):
     start = date(2016, 1, 20)
     end = date(2016, 1, 20)
     date_list = [d for d in days(start, end)]
     self.assertEqual(len(date_list), 1)
     self.assertEqual(date_list[0], start)
     self.assertEqual(date_list[len(date_list)-1], end)
Пример #3
0
 def test_two_dates(self):
     start = date(2016, 1, 20)
     end = date(2016, 1, 21)
     date_list = [d for d in days(start, end)]
     self.assertEqual(len(date_list), 2)
     self.assertEqual(date_list[0], start)
     self.assertEqual(date_list[len(date_list) - 1], end)
Пример #4
0
 def test_one_single_date(self):
     start = date(2016, 1, 20)
     end = date(2016, 1, 20)
     date_list = [d for d in days(start, end)]
     self.assertEqual(len(date_list), 1)
     self.assertEqual(date_list[0], start)
     self.assertEqual(date_list[len(date_list) - 1], end)
Пример #5
0
 def test_not_fetch_today(self):
     start = date.today()
     end = start
     date_list = [d for d in days(start, end)]
     self.assertEqual(len(date_list), 0)
Пример #6
0
 def test_empty_result_when_start_is_bigger_than_end(self):
     start = date(2016, 9, 2)
     end = date(2016, 1, 2)
     date_list = [d for d in days(start, end)]
     self.assertEqual(len(date_list), 0)
Пример #7
0
 def test_skip_saturdays(self):
     start = date(2016, 1, 2)
     end = date(2016, 1, 2)
     date_list = [d for d in days(start, end)]
     self.assertEqual(len(date_list), 0)
Пример #8
0
 def test_not_fetch_today(self):
     start = date.today()
     end = start
     date_list = [d for d in days(start, end)]
     self.assertEqual(len(date_list), 0)
Пример #9
0
 def test_empty_result_when_start_is_bigger_than_end(self):
     start = date(2016, 9, 2)
     end = date(2016, 1, 2)
     date_list = [d for d in days(start, end)]
     self.assertEqual(len(date_list), 0)
Пример #10
0
 def test_skip_saturdays(self):
     start = date(2016, 1, 2)
     end = date(2016, 1, 2)
     date_list = [d for d in days(start, end)]
     self.assertEqual(len(date_list), 0)