def test_subseconds_with_seconds(self): pi = Interval(seconds=12, microseconds=123456) self.assertEqual( '12 seconds', pi.in_words() )
def test_subseconds(self): pi = Interval(microseconds=123456) self.assertEqual( '0.12 second', pi.in_words() )
def test_separator(self): pi = Interval(days=1177, seconds=7284, microseconds=1000000) self.assertEqual( '168 weeks, 1 day, 2 hours, 1 minute, 25 seconds', pi.in_words(separator=', ') )
def test_singluar_negative_values(self): pi = Interval(days=-1) self.assertEqual( '-1 day', pi.in_words() )
def test_in_french(self): pi = Interval(days=1177, seconds=7284, microseconds=1000000) self.assertEqual( '168 semaines 1 jour 2 heures 1 minute 25 secondes', pi.in_words(locale='fr') )
def test_all(self): pi = Interval(days=1177, seconds=7284, microseconds=1000000) self.assertEqual( '168 weeks 1 day 2 hours 1 minute 25 seconds', pi.in_words() )