Ejemplo n.º 1
0
 def test_get_next_period(self):
     week = Week(2018, 3)
     next = week.get_next_period()
     self.assertEqual(2018, next.year)
     self.assertEqual(4, next.week)
Ejemplo n.º 2
0
 def test_get_next_period_year_border(self):
     week = Week(2017, 52)
     next = week.get_next_period()
     self.assertEqual(2018, next.year)
     self.assertEqual(1, next.week)
Ejemplo n.º 3
0
 def test_get_previous_period(self):
     week = Week(2018, 3)
     previous = week.get_previous_period()
     self.assertEqual(2018, previous.year)
     self.assertEqual(2, previous.week)
Ejemplo n.º 4
0
 def test_get_previous_period_year_crossing(self):
     week = Week(2018, 1)
     previous = week.get_previous_period()
     self.assertEqual(2017, previous.year)
     self.assertEqual(52, previous.week)
Ejemplo n.º 5
0
 def test_end(self):
     self.assertEqual(datetime(2015, 1, 5), Week(2015, 1).end)
     self.assertEqual(datetime(2016, 1, 11), Week(2016, 1).end)
     self.assertEqual(datetime(2017, 1, 9), Week(2017, 1).end)
     self.assertEqual(datetime(2018, 1, 8), Week(2018, 1).end)
     self.assertEqual(datetime(2018, 5, 28), Week(2018, 21).end)
Ejemplo n.º 6
0
 def test_end_year_crossing(self):
     week = Week(2017, 52)
     self.assertEqual(datetime(2018, 1, 1), week.end)
Ejemplo n.º 7
0
 def test_start(self):
     self.assertEqual(datetime(2014, 12, 29), Week(2015, 1).start)
     self.assertEqual(datetime(2016, 1, 4), Week(2016, 1).start)
     self.assertEqual(datetime(2017, 1, 2), Week(2017, 1).start)
     self.assertEqual(datetime(2018, 1, 1), Week(2018, 1).start)
     self.assertEqual(datetime(2018, 5, 21), Week(2018, 21).start)
Ejemplo n.º 8
0
 def test_get_next_period_year_border(self):
     week = Week(2017, 52)
     next = week.get_next_period()
     self.assertEqual(2018, next.year)
     self.assertEqual(1, next.week)
Ejemplo n.º 9
0
 def test_get_next_period(self):
     week = Week(2018, 3)
     next = week.get_next_period()
     self.assertEqual(2018, next.year)
     self.assertEqual(4, next.week)
Ejemplo n.º 10
0
 def test_get_previous_period_year_crossing(self):
     week = Week(2018, 1)
     previous = week.get_previous_period()
     self.assertEqual(2017, previous.year)
     self.assertEqual(52, previous.week)
Ejemplo n.º 11
0
 def test_get_previous_period(self):
     week = Week(2018, 3)
     previous = week.get_previous_period()
     self.assertEqual(2018, previous.year)
     self.assertEqual(2, previous.week)