def test_list_image_types_instance(self): types = IrsaDust().list_image_types() assert types is not None
def test_get_images_instance(self, monkeypatch): monkeypatch.setattr(IrsaDustClass, 'get_images_async', self.get_images_async_mockreturn) images = IrsaDust().get_images("m81") assert images is not None
def test_list_image_types_class(self): types = IrsaDust.list_image_types() assert types is not None
def test_get_images_async_instance(self, monkeypatch, image_type): monkeypatch.setattr(IrsaDustClass, 'get_image_list', self.get_image_list_mockreturn) readable_objs = IrsaDust().get_images_async("m81", image_type=image_type) assert readable_objs is not None
def test_get_images_class(self, monkeypatch): monkeypatch.setattr(IrsaDust, 'get_images_async', self.get_images_async_mockreturn) images = IrsaDust.get_images("m81") assert images is not None
def test_get_extinction_table_instance(self, monkeypatch): monkeypatch.setattr(IrsaDustClass, 'get_extinction_table_async', self.get_ext_table_async_mockreturn) table = IrsaDust().get_extinction_table("m31") assert table is not None
def test_get_image_list_instance(self, patch_request, image_type, expected_urls, patch_fromname): url_list = IrsaDust().get_image_list("m81", image_type=image_type) assert url_list == expected_urls
def test_query_table_instance(self, patch_request, section, expected_length, patch_fromname): qtable = IrsaDust.get_query_table("m31", section=section) assert len(qtable.colnames) == expected_length
def test_get_extinction_table_async_instance(self, patch_request, patch_fromname): readable_obj = IrsaDust().get_extinction_table_async("m31") assert readable_obj is not None
def test_extract_image_urls_class__err(self): raw_xml = self.read_data(M31_XML) with pytest.raises(ValueError): IrsaDust.extract_image_urls(raw_xml, image_type="l")
def test_extract_image_urls_class(self, image_type, expected_urls): raw_xml = self.read_data(M31_XML) url_list = IrsaDust.extract_image_urls(raw_xml, image_type=image_type) assert url_list == expected_urls
def test_args_to_payload_class_3(self, radius, patch_fromname): errmsg = ("Radius (in any unit) must be in the" " range of 2.0 to 37.5 degrees") with pytest.raises(ValueError) as ex: IrsaDust._args_to_payload("m81", radius=radius) assert ex.value.args[0] == errmsg
def test_args_to_payload_class_2(self, patch_fromname): with pytest.raises(Exception) as ex: IrsaDust._args_to_payload("m81", radius="5") assert ex.value.args[0] == "No unit specified"
def test_args_to_payload_class_1(self, coordinate, radius, expected_payload, patch_fromname): payload = IrsaDust._args_to_payload(coordinate, radius=radius) assert payload == expected_payload