def test_wsdl_retriever_wsdl(mock_taverna_parser, mock_webservice_parser, mock_link_test): """ Unable to find any valid Taverna URLs? Raise ValueError """ with pytest.raises(ValueError): wsdl_retriever()
def __init__(self, link=None): """ The constructor; establishes the webservice link for the client Initializes the client with a weblink Parameters ---------- link : str Contains URL to valid WSDL endpoint Examples -------- >>> from sunpy.net.helio import hec >>> hc = hec.HECClient() # doctest: +REMOTE_DATA """ if link is None: # The default wsdl file link = parser.wsdl_retriever() self.votable_interceptor = VotableInterceptor() self.hec_client = C(link, plugins=[self.votable_interceptor], transport=WellBehavedHttpTransport())
def __init__(self, link=None): """ The constructor; establishes the webservice link for the client Initializes the client with a weblink Parameters ---------- link : str Contains URL to valid WSDL endpoint Examples -------- >>> from sunpy.net.helio import hec >>> hc = hec.HECClient() # doctest: +REMOTE_DATA """ if link is None: # The default wsdl file link = parser.wsdl_retriever() # Disable SSL check. session = Session() session.verify = False transport = Transport(session=session) self.hec_client = Client(link, transport=transport)
def __init__(self, link=None): """ The constructor; establishes the webservice link for the client Initializes the client with a weblink Parameters ---------- link: str Contains URL to valid WSDL endpoint Examples -------- >>> hc = hec.HECClient() """ if link is None: # The default wsdl file link = parser.wsdl_retriever() self.votable_interceptor = VotableInterceptor() self.hec_client = C(link, plugins=[self.votable_interceptor], transport=WellBehavedHttpTransport())
def __init__(self, link=None): """ The constructor; establishes the webservice link for the client Initializes the client with a weblink Parameters ---------- link : str Contains URL to valid WSDL endpoint Examples -------- >>> from sunpy.net.helio import hec >>> hc = hec.HECClient() # doctest: +REMOTE_DATA """ if link is None: # The default wsdl file link = parser.wsdl_retriever() self.hec_client = zeep.Client(link)
def __init__(self, link=None): """ The constructor; establishes the webservice link for the client Initializes the client with a weblink Parameters ---------- link : str Contains URL to valid WSDL endpoint Examples -------- >>> from sunpy.net.helio import hec >>> hc = hec.HECClient() # doctest: +REMOTE_DATA """ if link is None: # The default wsdl file link = parser.wsdl_retriever() session = Session() # This is for use in our test suite. session.verify = not (bool(os.environ.get("NO_VERIFY_HELIO_SSL", 0))) transport = Transport(session=session) self.hec_client = Client(link, transport=transport)
def test_wsdl_retriever_get_link(mock_link_test, mock_taverna_parser, mock_webservice_parser): """ Get a Taverna link """ assert wsdl_retriever() == 'http://www.helio.uk/Taverna/hec?wsdl'
Access the Helio Event Catalogue """ from sunpy.net.proxyfix import WellBehavedHttpTransport from sunpy.net.helio import parser from sunpy.time import time as T from suds.client import Client as C from astropy.io.votable.table import parse_single_table import io __author__ = "Michael Malocha" __version__ = "September 22nd, 2013" __all__ = ["HECClient"] # The default wsdl file DEFAULT_LINK = parser.wsdl_retriever() def suds_unwrapper(wrapped_data): """ Removes suds wrapping from returned xml data When grabbing data via client.last_received() from the suds.client.Client module, it returns the xml data in an un-helpful "<s:Envelope>" that needs to be removed. This function politely cleans it up. Parameters ---------- wrapped_data: str Contains the wrapped xml results from a WSDL query
def test_wsdl_retriever_no_content(mock_endpoint_parser): """ No links found? Raise ValueError """ with pytest.raises(ValueError): wsdl_retriever()
def test_wsdl_retriever_no_content(mock_endpoint_parser): """ No links found? Return None """ assert wsdl_retriever() is None
def test_wsdl_retriever_no_taverna_urls(mock_taverna_parser, mock_webservice_parser): """ Unable to find any valid Taverna URLs? Return None """ assert wsdl_retriever() is None