def test_timedelta():
 timedelta_chart = TimeDeltaLine(truncate_label=1000)
 timedelta_chart.add('timedeltas', [(timedelta(seconds=1), 10), (timedelta(weeks=1), 50), (timedelta(hours=3, seconds=30), 3), (timedelta(microseconds=12112), 0.3)])
 q = timedelta_chart.render_pyquery()
 assert (list((t for t in q('.axis.x text').map(texts) if (t != '0:00:00'))) == ['1 day, 3:46:40', '2 days, 7:33:20', '3 days, 11:20:00', '4 days, 15:06:40', '5 days, 18:53:20', '6 days, 22:40:00'])

def test_timedelta ( ) : timedelta_chart = TimeDeltaLine ( truncate_label = 1000 ) timedelta_chart . add ( 'timedeltas' , [ ( timedelta ( seconds = 1 ) , 10 ) , ( timedelta ( weeks = 1 ) , 50 ) , ( timedelta ( hours = 3 , seconds = 30 ) , 3 ) , ( timedelta ( microseconds = 12112 ) , 0.3 ) ] ) q = timedelta_chart . render_pyquery ( ) assert ( list ( ( t for t in q ( '.axis.x text' ) . map ( texts ) if ( t != '0:00:00' ) ) ) == [ '1 day, 3:46:40' , '2 days, 7:33:20' , '3 days, 11:20:00' , '4 days, 15:06:40' , '5 days, 18:53:20' , '6 days, 22:40:00' ] )
test a simple timedeltaline .