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