def test_skycoord_representation():
 c = coordinates.SkyCoord([0], [1], [0], representation='cartesian')
 t = Table([c])
 assert (t.pformat() == ['     col0     ', 'None,None,None', '--------------', '   0.0,1.0,0.0'])
 c = coordinates.SkyCoord([0], [1], [0], unit='m', representation='cartesian')
 t = Table([c])
 assert (t.pformat() == ['    col0   ', '   m,m,m   ', '-----------', '0.0,1.0,0.0'])
 t['col0'].representation = 'unitspherical'
 assert (t.pformat() == ['  col0  ', 'deg,deg ', '--------', '90.0,0.0'])
 t['col0'].representation = 'cylindrical'
 assert (t.pformat() == ['    col0    ', '  m,deg,m   ', '------------', '1.0,90.0,0.0'])

def test_skycoord_representation ( ) : c = coordinates . SkyCoord ( [ 0 ] , [ 1 ] , [ 0 ] , representation = 'cartesian' ) t = Table ( [ c ] ) assert ( t . pformat ( ) == [ '     col0     ' , 'None,None,None' , '--------------' , '   0.0,1.0,0.0' ] ) c = coordinates . SkyCoord ( [ 0 ] , [ 1 ] , [ 0 ] , unit = 'm' , representation = 'cartesian' ) t = Table ( [ c ] ) assert ( t . pformat ( ) == [ '    col0   ' , '   m,m,m   ' , '-----------' , '0.0,1.0,0.0' ] ) t [ 'col0' ] . representation = 'unitspherical' assert ( t . pformat ( ) == [ '  col0  ' , 'deg,deg ' , '--------' , '90.0,0.0' ] ) t [ 'col0' ] . representation = 'cylindrical' assert ( t . pformat ( ) == [ '    col0    ' , '  m,deg,m   ' , '------------' , '1.0,90.0,0.0' ] )
test that skycoord representation works .