def test_simple_bar():
 bar = Bar()
 rng = [(-3), (-32), (-39)]
 bar.add('test1', rng)
 bar.add('test2', map(abs, rng))
 bar.x_labels = map(str, rng)
 bar.title = 'Bar test'
 q = bar.render_pyquery()
 assert (len(q('.axis.x')) == 1)
 assert (len(q('.axis.y')) == 1)
 assert (len(q('.legend')) == 2)
 assert (len(q('.plot .series rect')) == (2 * 3))

def test_simple_bar ( ) : bar = Bar ( ) rng = [ ( - 3 ) , ( - 32 ) , ( - 39 ) ] bar . add ( 'test1' , rng ) bar . add ( 'test2' , map ( abs , rng ) ) bar . x_labels = map ( str , rng ) bar . title = 'Bar test' q = bar . render_pyquery ( ) assert ( len ( q ( '.axis.x' ) ) == 1 ) assert ( len ( q ( '.axis.y' ) ) == 1 ) assert ( len ( q ( '.legend' ) ) == 2 ) assert ( len ( q ( '.plot .series rect' ) ) == ( 2 * 3 ) )
simple bar test .