def test_to_string():
 coord = u'1h2m3s 1d2m3s'
 for wrap in ((lambda x: x), (lambda x: [x])):
  sc = SkyCoord(wrap(coord))
  assert (sc.to_string() == wrap(u'15.5125 1.03417'))
  assert (sc.to_string(u'dms') == wrap(u'15d30m45s 1d02m03s'))
  assert (sc.to_string(u'hmsdms') == wrap(u'01h02m03s +01d02m03s'))
  with_kwargs = sc.to_string(u'hmsdms', precision=3, pad=True, alwayssign=True)
  assert (with_kwargs == wrap(u'+01h02m03.000s +01d02m03.000s'))

def test_to_string ( ) : coord = u'1h2m3s 1d2m3s' for wrap in ( ( lambda x : x ) , ( lambda x : [ x ] ) ) : sc = SkyCoord ( wrap ( coord ) ) assert ( sc . to_string ( ) == wrap ( u'15.5125 1.03417' ) ) assert ( sc . to_string ( u'dms' ) == wrap ( u'15d30m45s 1d02m03s' ) ) assert ( sc . to_string ( u'hmsdms' ) == wrap ( u'01h02m03s +01d02m03s' ) ) with_kwargs = sc . to_string ( u'hmsdms' , precision = 3 , pad = True , alwayssign = True ) assert ( with_kwargs == wrap ( u'+01h02m03.000s +01d02m03.000s' ) )
basic testing of converting skycoord to strings .