def test_fixes():
 def run():
  header = get_pkg_data_contents(u'data/nonstandard_units.hdr', encoding=u'binary')
  try:
   w = wcs.WCS(header, translate_units=u'dhs')
  except wcs.InvalidTransformError:
   pass
  else:
   assert False, u'Expected InvalidTransformError'
 with catch_warnings(wcs.FITSFixedWarning) as w:
  run()
 assert (len(w) == 2)
 for item in w:
  if (u'unitfix' in str(item.message)):
   assert (u'Hz' in str(item.message))
   assert (u'M/S' in str(item.message))
   assert (u'm/s' in str(item.message))

def test_fixes ( ) : def run ( ) : header = get_pkg_data_contents ( u'data/nonstandard_units.hdr' , encoding = u'binary' ) try : w = wcs . WCS ( header , translate_units = u'dhs' ) except wcs . InvalidTransformError : pass else : assert False , u'Expected InvalidTransformError' with catch_warnings ( wcs . FITSFixedWarning ) as w : run ( ) assert ( len ( w ) == 2 ) for item in w : if ( u'unitfix' in str ( item . message ) ) : assert ( u'Hz' in str ( item . message ) ) assert ( u'M/S' in str ( item . message ) ) assert ( u'm/s' in str ( item . message ) )
from github issue #36 .