def test_get_images_async():
    with patch('astroquery.utils.commons.get_readable_fileobj', autospec=True) as readable_fobj_mock:
        readable_fobj_mock.return_value = open(data_path('query_images.fits'), 'rb')

    cadc = Cadc()
    readable_objs = cadc.get_images_async('08h45m07.5s +54d18m00s',
                                          0.01*u.arcmin,
                                          get_url_list=True)
    assert readable_objs == ['https://some.url']

    readable_objs = cadc.get_images_async('08h45m07.5s +54d18m00s',
                                          '0.01 arcsec')
    assert readable_objs is not None
    assert isinstance(readable_objs[0], FileContainer)
 def test_get_images_async(self):
     cadc = Cadc()
     coords = '01h45m07.5s +23d18m00s'
     radius = '0.05 deg'
     readable_objs = cadc.get_images_async(coords,
                                           radius,
                                           collection="CFHT")
     assert readable_objs is not None
     for obj in readable_objs:
         assert isinstance(obj, FileContainer)