def test_EngFormatter_formatting():
 unitless = mticker.EngFormatter()
 assert (unitless(0.1) == u'100 m')
 assert (unitless(1) == u'1')
 assert (unitless(999.9) == u'999.9')
 assert (unitless(1001) == u'1.001 k')
 with_unit = mticker.EngFormatter(unit=u's')
 assert (with_unit(0.1) == u'100 ms')
 assert (with_unit(1) == u'1 s')
 assert (with_unit(999.9) == u'999.9 s')
 assert (with_unit(1001) == u'1.001 ks')

def test_EngFormatter_formatting ( ) : unitless = mticker . EngFormatter ( ) assert ( unitless ( 0.1 ) == u'100 m' ) assert ( unitless ( 1 ) == u'1' ) assert ( unitless ( 999.9 ) == u'999.9' ) assert ( unitless ( 1001 ) == u'1.001 k' ) with_unit = mticker . EngFormatter ( unit = u's' ) assert ( with_unit ( 0.1 ) == u'100 ms' ) assert ( with_unit ( 1 ) == u'1 s' ) assert ( with_unit ( 999.9 ) == u'999.9 s' ) assert ( with_unit ( 1001 ) == u'1.001 ks' )
create two instances of engformatter with default parameters .