Ejemplo n.º 1
0
 def test_total_years(self):
     it = Interval(days=365)
     self.assertEqual(1, it.total_years())
Ejemplo n.º 2
0
 def test_in_minutes(self):
     it = Interval(minutes=6, seconds=72)
     self.assertEqual(7.2, it.total_minutes())
Ejemplo n.º 3
0
 def test_in_seconds(self):
     it = Interval(seconds=72, microseconds=123456)
     self.assertEqual(72.123456, it.total_seconds())
Ejemplo n.º 4
0
 def test_in_days(self):
     it = Interval(days=3)
     self.assertEqual(3, it.total_days())
Ejemplo n.º 5
0
 def test_in_hours(self):
     it = Interval(days=3, minutes=72)
     self.assertEqual(73.2, it.total_hours())
Ejemplo n.º 6
0
 def test_in_weeks(self):
     it = Interval(days=17)
     self.assertEqual(2.43, round(it.total_weeks(), 2))
Ejemplo n.º 7
0
 def test_in_months(self):
     it = Interval(days=75)
     self.assertEqual(2.5, it.total_months())
Ejemplo n.º 8
0
 def test_in_weeks(self):
     it = Interval(days=17)
     self.assertEqual(2, it.in_weeks())
Ejemplo n.º 9
0
 def test_in_seconds(self):
     it = Interval(seconds=72)
     self.assertEqual(72, it.in_seconds())
Ejemplo n.º 10
0
 def test_in_years(self):
     it = Interval(days=365)
     self.assertEqual(1, it.in_years())