def test_request_get_exceptions(): """Tests of Request.get() that don't require remote data.""" req = pandasdmx.Request("ESTAT") # Exception is raised on unrecognized arguments exc = "unrecognized arguments: {'foo': 'bar'}" with pytest.raises(ValueError, match=exc): req.get("datastructure", foo="bar") with pytest.raises(ValueError, match=exc): pandasdmx.read_url("https://example.com", foo="bar")
def test_request_get_exceptions(): """Tests of Request.get() that don't require remote data.""" req = sdmx.Request('ESTAT') # Exception is raised on unrecognized arguments exc = "unrecognized arguments: {'foo': 'bar'}" with pytest.raises(ValueError, match=exc): req.get('datastructure', foo='bar') with pytest.raises(ValueError, match=exc): sdmx.read_url('https://example.com', foo='bar')
def main(): logging.basicConfig(level=logging.DEBUG) pandasdmx.add_source(SOURCE) # source = pandasdmx.source.Source(**SOURCE) # pandasdmx.Resource # # request = pandasdmx.Request(source='NOMIS') # # LOGGER.debug(request.source) # # response = request.datastructure('NM_1_1') # # print(response) objt = pandasdmx.read_url('https://www.nomisweb.co.uk/api/v01/dataset/def.sdmx.xml') print(repr(objt)) print(objt)
def test_read_url(): # URL can be queried without instantiating Request pandasdmx.read_url( "https://sdw-wsrest.ecb.europa.eu/service/datastructure/ECB/" "ECB_EXR1/latest?references=all")
def test_read_url(): # URL can be queried without instantiating Request sdmx.read_url('http://sdw-wsrest.ecb.int/service/datastructure/ECB/' 'ECB_EXR1/latest?references=all')