diff --git a/AUTHORS.txt b/AUTHORS.txt index cc0c89a45..6873492c5 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -18,3 +18,4 @@ Steve Nesbitt Warren Pettee Zachary Bruick Scott Havens +James Polly diff --git a/src/siphon/catalog.py b/src/siphon/catalog.py index 46bcaca3c..105704b5f 100644 --- a/src/siphon/catalog.py +++ b/src/siphon/catalog.py @@ -559,15 +559,13 @@ def make_access_urls(self, catalog_url, all_services, metadata=None): for subservice in service.services: all_service_dict[subservice.name] = subservice - service_name = metadata.get('serviceName', None) - access_urls = CaseInsensitiveDict({}) server_url = _find_base_tds_url(catalog_url) # process access urls for datasets that reference top # level catalog services (individual or compound service # types). - if service_name in all_service_dict: + for service_name in all_service_dict: service = all_service_dict[service_name] if service.service_type != 'Resolver': # if service is a CompoundService, create access url diff --git a/tests/test_catalog.py b/tests/test_catalog.py index 98747070b..e00cfbf44 100644 --- a/tests/test_catalog.py +++ b/tests/test_catalog.py @@ -331,9 +331,30 @@ def test_simple_service_within_compound(): 'tropical/atlantic/hdob/catalog.xml') cat = TDSCatalog(url) assert (cat.datasets[0].access_urls - == {'HTTPServer': 'http://thredds-test.unidata.ucar.edu/thredds/' - 'fileServer/noaaport/text/tropical/atlantic/hdob/' - 'High_density_obs_20170824.txt'}) + == {'CdmRemote': 'http://thredds-test.unidata.ucar.edu/thredds/' + 'cdmremote/noaaport/text/tropical/atlantic/' + 'hdob/High_density_obs_20170824.txt', + 'CdmrFeature': 'http://thredds-test.unidata.ucar.edu/thredds/' + 'cdmrfeature/grid/noaaport/text/tropical/atlantic/' + 'hdob/High_density_obs_20170824.txt', + 'HTTPServer': 'http://thredds-test.unidata.ucar.edu/thredds/' + 'fileServer/noaaport/text/tropical/atlantic/' + 'hdob/High_density_obs_20170824.txt', + 'ISO': 'http://thredds-test.unidata.ucar.edu/thredds/iso/noaaport/' + 'text/tropical/atlantic/hdob/High_density_obs_20170824.txt', + 'NCML': 'http://thredds-test.unidata.ucar.edu/thredds/ncml/noaaport/' + 'text/tropical/atlantic/hdob/High_density_obs_20170824.txt', + 'NetcdfSubset': 'http://thredds-test.unidata.ucar.edu/thredds/ncss/' + 'noaaport/text/tropical/atlantic/hdob/' + 'High_density_obs_20170824.txt', + 'OPENDAP': 'http://thredds-test.unidata.ucar.edu/thredds/dodsC/noaaport/' + 'text/tropical/atlantic/hdob/High_density_obs_20170824.txt', + 'UDDC': 'http://thredds-test.unidata.ucar.edu/thredds/uddc/noaaport/' + 'text/tropical/atlantic/hdob/High_density_obs_20170824.txt', + 'WCS': 'http://thredds-test.unidata.ucar.edu/thredds/wcs/noaaport/text/' + 'tropical/atlantic/hdob/High_density_obs_20170824.txt', + 'WMS': 'http://thredds-test.unidata.ucar.edu/thredds/wms/noaaport/text/' + 'tropical/atlantic/hdob/High_density_obs_20170824.txt'}) @recorder.use_cassette('rsmas_ramadda') diff --git a/tests/test_catalog_access.py b/tests/test_catalog_access.py index f2b117e1d..52cb36d4c 100644 --- a/tests/test_catalog_access.py +++ b/tests/test_catalog_access.py @@ -173,8 +173,8 @@ def test_case_insensitive_access(caplog): 'tropical/atlantic/hdob/catalog.xml') cat = TDSCatalog(url) access_name = list(cat.datasets[0].access_urls.keys())[0] - assert access_name == 'HTTPSERVER' # test __eq__ - assert not access_name != 'HTTPSERVER' # test __eq__ + assert access_name == 'OPENDAP' # test __eq__ + assert not access_name != 'OPENDAP' # test __eq__ assert access_name > 'a' # test __gt__ assert access_name >= 'a' # test __ge__ assert access_name < 'Z' # test __lt__ @@ -194,7 +194,33 @@ def test_manage_access_types_case_insensitive(caplog): test_string = 'test' http_url = ('http://thredds-test.unidata.ucar.edu/thredds/fileServer/noaaport/' 'text/tropical/atlantic/hdob/High_density_obs_20170824.txt') - assert ds.access_urls == {'HTTPSERVER': http_url} # test __eq__ + test_access_urls = { + 'CdmRemote': ('http://thredds-test.unidata.ucar.edu/thredds/' + 'cdmremote/noaaport/text/tropical/atlantic/' + 'hdob/High_density_obs_20170824.txt'), + 'CdmrFeature': ('http://thredds-test.unidata.ucar.edu/thredds/' + 'cdmrfeature/grid/noaaport/text/tropical/atlantic/' + 'hdob/High_density_obs_20170824.txt'), + 'HTTPServer': ('http://thredds-test.unidata.ucar.edu/thredds/' + 'fileServer/noaaport/text/tropical/atlantic/' + 'hdob/High_density_obs_20170824.txt'), + 'ISO': ('http://thredds-test.unidata.ucar.edu/thredds/iso/noaaport/' + 'text/tropical/atlantic/hdob/High_density_obs_20170824.txt'), + 'NCML': ('http://thredds-test.unidata.ucar.edu/thredds/ncml/noaaport/' + 'text/tropical/atlantic/hdob/High_density_obs_20170824.txt'), + 'NetcdfSubset': ('http://thredds-test.unidata.ucar.edu/thredds/ncss/' + 'noaaport/text/tropical/atlantic/hdob/' + 'High_density_obs_20170824.txt'), + 'OPENDAP': ('http://thredds-test.unidata.ucar.edu/thredds/dodsC/noaaport/' + 'text/tropical/atlantic/hdob/High_density_obs_20170824.txt'), + 'UDDC': ('http://thredds-test.unidata.ucar.edu/thredds/uddc/noaaport/' + 'text/tropical/atlantic/hdob/High_density_obs_20170824.txt'), + 'WCS': ('http://thredds-test.unidata.ucar.edu/thredds/wcs/noaaport/text/' + 'tropical/atlantic/hdob/High_density_obs_20170824.txt'), + 'WMS': ('http://thredds-test.unidata.ucar.edu/thredds/wms/noaaport/text/' + 'tropical/atlantic/hdob/High_density_obs_20170824.txt') + } + assert ds.access_urls == test_access_urls # test __eq__ assert ds.access_urls[wrong_case_key] == http_url # test __getitem___ assert wrong_case_key in ds.access_urls # test __contains__ ds.access_urls[wrong_case_key] = test_string