<s> import quantities as pq <EOL> from pylatex . quantities import _dimensionality_to_siunitx , Quantity <EOL> def test_quantity ( ) : <EOL> v = <NUM_LIT:1> * pq . m / pq . s <EOL> q1 = Quantity ( v ) <EOL> assert q1 . dumps ( ) == r'<STR_LIT>' <EOL> q2 = Quantity ( v , format_cb = lambda x : str ( int ( x ) ) ) <EOL> assert q2 . dumps ( ) == r'<STR_LIT>' <EOL> q3 = Quantity ( v , options = { '<STR_LIT>' : '<STR_LIT:true>' } ) <EOL> ref = r'<STR_LIT>' <EOL> assert q3 . dumps ( ) == ref <EOL> def test_quantity_float ( ) : <EOL> q1 = Quantity ( <NUM_LIT> ) <EOL> assert q1 . dumps ( ) == r'<STR_LIT>' <EOL> def test_quantity_uncertain ( ) : <EOL> t = pq . UncertainQuantity ( <NUM_LIT> , pq . second , <NUM_LIT:1.> ) <EOL> q1 = Quantity ( t ) <EOL> assert q1 . dumps ( ) == r'<STR_LIT>' <EOL> def test_dimensionality_to_siunitx ( ) : <EOL> assert _dimensionality_to_siunitx ( ( pq . volt / pq . kelvin ) . dimensionality ) == r'<STR_LIT>' <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> test_quantity ( ) <EOL> test_dimensionality_to_siunitx ( ) </s>
