def test_angle_format_roundtripping():
 a1 = Angle(0, unit=u.radian)
 a2 = Angle(10, unit=u.degree)
 a3 = Angle(0.543, unit=u.degree)
 a4 = Angle(u'1d2m3.4s')
 assert (Angle(str(a1)).degree == a1.degree)
 assert (Angle(str(a2)).degree == a2.degree)
 assert (Angle(str(a3)).degree == a3.degree)
 assert (Angle(str(a4)).degree == a4.degree)
 ra = Longitude(u'1h2m3.4s')
 dec = Latitude(u'1d2m3.4s')
 assert_allclose(Angle(str(ra)).degree, ra.degree)
 assert_allclose(Angle(str(dec)).degree, dec.degree)

def test_angle_format_roundtripping ( ) : a1 = Angle ( 0 , unit = u . radian ) a2 = Angle ( 10 , unit = u . degree ) a3 = Angle ( 0.543 , unit = u . degree ) a4 = Angle ( u'1d2m3.4s' ) assert ( Angle ( str ( a1 ) ) . degree == a1 . degree ) assert ( Angle ( str ( a2 ) ) . degree == a2 . degree ) assert ( Angle ( str ( a3 ) ) . degree == a3 . degree ) assert ( Angle ( str ( a4 ) ) . degree == a4 . degree ) ra = Longitude ( u'1h2m3.4s' ) dec = Latitude ( u'1d2m3.4s' ) assert_allclose ( Angle ( str ( ra ) ) . degree , ra . degree ) assert_allclose ( Angle ( str ( dec ) ) . degree , dec . degree )
ensures that the string representation of an angle can be used to create a new valid angle .