def test_url_parameter_case_insensitivity(self): """ 17. URL Parameter Case Insensitivity """ # Randomly capitalizes and lower-cases parameters and checks the tile resulting from the request. Tries 10 different combinations. ref_hash = '3f84501587adfe3006dcbf59e67cd0a3' params = ('layer=test_weekly_jpg', 'TileMatrix=0', 'Service=WMTS', 'request=GetTile', 'version=1.0.0', 'time=default', 'TileMatrixSet=EPSG4326_16km', 'format=image%2Fjpeg', 'tilecol=0', 'tilerow=0') if DEBUG: print '\nTesting URL Parameter Insensitivity' for _ in range(10): test_params = [] for param in params: param_split = param.split('=') case = random.randint(0, 1) if case: param_split[0] = param_split[0].upper() else: param_split[0] = param_split[0].lower() test_params.append('='.join(param_split)) req_url = 'http://localhost/onearth/test/wmts/wmts.cgi?' + '&'.join(test_params) if DEBUG: print 'Trying URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'URL parameter case insensitivity request does not match what\'s expected. URL: ' + req_url)
def test_request_twms_year_zlevel(self): """ 11. Request tile with date and time (z-level) from "year" layer via TWMS """ ref_hash = '36bb79a33dbbe6173990103a8d6b67cb' req_url = 'http://localhost/onearth/test/twms/twms.cgi?request=GetMap&layers=test_zindex_jpg&srs=EPSG:4326&format=image%2Fjpeg&styles=&time=2012-02-29T16:00:00Z&width=512&height=512&bbox=-180,0,-90,90' check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'TWMS current PNG request does not match what\'s expected. URL: ' + req_url)
def test_twms_get_capabilities(self): """ 15. Request TWMS GetCapabilities """ ref_hash = 'd2536cb2c0681c56b005eb9d60336326' req_url = 'http://localhost/onearth/test/twms/twms.cgi?Request=GetCapabilities' if DEBUG: print '\nTesting TWMS GetCapablities' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'TWMS Get GetCapabilities Request does not match what\'s expected. URL: ' + req_url)
def test_twms_get_tile_service(self): """ 16. Request TWMS GetTileService """ ref_hash = '7555d5ad3cca96aa8cbc8a36f5e04f19' req_url = 'http://localhost/onearth/test/twms/twms.cgi?Request=GetTileService' if DEBUG: print '\nTesting WMTS GetTileService' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'TWMS Get GetTileService Request does not match what\'s expected. URL: ' + req_url)
def test_request_twms_date_png(self): """ 13. Request tile with date via TWMS """ ref_hash = '944c7ce9355cb0aa29930dc16ab03db6' req_url = 'http://localhost/onearth/test/twms/twms.cgi?request=GetMap&layers=test_daily_png&srs=EPSG:4326&format=image%2Fpng&styles=&&width=512&height=512&bbox=-180,-198,108,90&TIME=2012-02-29' if DEBUG: print '\nTesting: Request tile with date via TWMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'TWMS PNG request with date does not match what\'s expected. URL: ' + req_url)
def test_request_wmts_legacy_datetime_from_year_layer(self): """ 9. Request tile with date and time (sub-daily) from "year" layer via WMTS """ ref_hash = '5a39c4e335d05295160a7bec4961002d' req_url = 'http://localhost/onearth/test/wmts/wmts.cgi?layer=test_legacy_subdaily_jpg&tilematrixset=EPSG4326_16km&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix=0&TileCol=0&TileRow=0&TIME=2012-02-29T12:00:00Z' if DEBUG: print '\nTesting: Request tile with date and time (legacy sub-daily) from "year" layer via WMTS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMTS legacy subdaily request does not match what\'s expected. URL: ' + req_url)
def test_wmts_get_capabilities(self): """ 14. Request WMTS GetCapabilities """ ref_hash = 'b49538ed143340f11230eac8b8f9ecca' req_url = 'http://localhost/onearth/test/wmts/wmts.cgi?Request=GetCapabilities' if DEBUG: print '\nTesting WMTS GetCapablities' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WTMTS Get GetCapabilities Request does not match what\'s expected. URL: ' + req_url)
def test_request_wmts_year_zlevel(self): """ 10. Request tile with date and time (z-level) from "year" layer via WMTS """ ref_hash = '36bb79a33dbbe6173990103a8d6b67cb' req_url = 'http://localhost/onearth/test/wmts/wmts.cgi?layer=test_zindex_jpg&tilematrixset=EPSG4326_16km&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix=0&TileCol=0&TileRow=0&TIME=2012-02-29T16:00:00Z' if DEBUG: print '\nTesting: Request tile with date and time (z-level) from "year" layer via WMTS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMTS Z-Level JPG Tile Request does not match what\'s expected. URL: ' + req_url)
def test_request_wmts_date_from_year_layer(self): """ 7. Request tile with date from "year" layer via WMTS """ ref_hash = '9b38d90baeeebbcadbc8560a29481a5e' req_url = 'http://localhost/onearth/test/wmts/wmts.cgi?layer=test_weekly_jpg&tilematrixset=EPSG4326_16km&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix=0&TileCol=0&TileRow=0&time=2012-02-22' if DEBUG: print '\nTesting: Request tile with date from "year" layer via WMTS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMTS date request from "year" layer does not match what\'s expected. URL: ' + req_url)
def test_request_wms_reprojection_multilayer(self): """ 19. Request multiple layers and reproject from EPSG:4326 to EPSG:3857 via WMS """ ref_hash = 'cc013129f771402ccf443ff729e3fe52' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=test_static_jpg,snap_test_3a,snap_test_3b&map.layer[snap_test_3a]=OPACITY+50&map.layer[snap_test_3b]=OPACITY+50&CRS=EPSG:3857&STYLES=&WIDTH=1280&HEIGHT=1280&BBOX=-20037508.34,-20037508.34,20037508.34,20037508.34&TIME=2015-01-01' if DEBUG: print '\nTesting: Request multiple layers and reproject from EPSG:4326 to EPSG:3857 via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMS multiple layers and reproject from EPSG:4326 to EPSG:3857 does not match what\'s expected. URL: ' + req_url)
def test_request_wms_subdaily_timesnap(self): """ 20. Request tile with time (sub-daily) and snap to available date time via WMS """ ref_hash = 'dbb24bb1dcb5346de0a44523040d0b93' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=test_legacy_subdaily_jpg&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&TIME=2012-02-29T12:00:00Z' if DEBUG: print '\nTesting: Request tile with date and time (sub-daily) and another layer with YYYY-MM-DD time via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMS tile with date and time (sub-daily) and another layer with YYYY-MM-DD time does not match what\'s expected. URL: ' + req_url)
def test_request_wms_baddateformat(self): """ 17. Request multiple layers with bad date format via WMS """ ref_hash = 'd41d8cd98f00b204e9800998ecf8427e' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=snap_test_3a,snap_test_3b&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&TIME=2016-03-002' if DEBUG: print '\nTesting: Request multiple layers bad date format via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMS multiple layers bad date format does not match what\'s expected. URL: ' + req_url)
def test_request_wms_reprojection(self): """ 18. Request layer with date and reproject from EPSG:4326 to EPSG:3857 via WMS """ ref_hash = '50843cf95d86d9139643f9fcd1d048ec' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=test_weekly_jpg&CRS=EPSG%3A3857&STYLES=&WIDTH=1280&HEIGHT=1280&BBOX=-20037508.34,-20037508.34,20037508.34,20037508.34&time=2012-02-22' if DEBUG: print '\nTesting: Request layer with date and reproject from EPSG:4326 to EPSG:3857' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMS request layer with date and reproject from EPSG:4326 to EPSG:3857 does not match what\'s expected. URL: ' + req_url)
def test_request_wmts_date_from_noyear_layer(self): """ 8. Request tile with date from "non-year" layer via WMTS """ ref_hash = '3f84501587adfe3006dcbf59e67cd0a3' req_url = 'http://localhost/onearth/test/wmts/wmts.cgi?layer=test_nonyear_jpg&tilematrixset=EPSG4326_16km&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix=0&TileCol=0&TileRow=0&TIME=2012-02-29' if DEBUG: print '\nTesting: Request tile with date from "non-year layer via WMTS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMTS date request from "non-year" layer does not match what\'s expected. URL: ' + req_url)
def test_request_wmts_default_time_png(self): """ 4. Request current (time=default) PNG tile via WMTS """ ref_hash = '944c7ce9355cb0aa29930dc16ab03db6' req_url = 'http://localhost/onearth/test/wmts/wmts.cgi?layer=test_daily_png&tilematrixset=EPSG4326_16km&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix=0&TileCol=0&TileRow=0&TIME=default' if DEBUG: print '\nTesting: Request current (time=default) PNG tile via WMTS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'Current (TIME=default) WMTS PNG Tile Request does not match what\'s expected. URL: ' + req_url)
def test_request_wms_datetime_with_regular_time(self): """ 12. Request tile with date and time (sub-daily) and another layer with YYYY-MM-DD time via WMS """ ref_hash = '93fccd7bcd34f4ff179498c09b4876e8' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=test_weekly_jpg,test_legacy_subdaily_jpg&map.layer[test_legacy_subdaily_jpg]=OPACITY+50&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&TIME=2012-02-29T12:00:00Z' if DEBUG: print '\nTesting: Request tile with date and time (sub-daily) and another layer with YYYY-MM-DD time via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMS tile with date and time (sub-daily) and another layer with YYYY-MM-DD time does not match what\'s expected. URL: ' + req_url)
def test_request_wfs_csv_with_time(self): """ 25. Request CSV from vector source file with time via WFS """ ref_hash = '416ff6eeedf4150c358bdade4994718f' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TYPENAME=Terra_Orbit_Dsc_Dots&OUTPUTFORMAT=csv&TIME=2016-03-05' if DEBUG: print '\nTesting: Request CSV from vector source file with time via WFS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMS request CSV from vector source file with time via WFS does not match what\'s expected. URL: ' + req_url)
def test_wfs_get_capabilities_2_0_0(self): """ 10. Request WFS GetCapabilities 2.0.0 """ ref_hash = '74541c28d6b94185c1139073b309dd29' req_url = 'http://localhost/onearth/test/wfs/mapserv?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetCapabilities' if DEBUG: print '\nTesting WFS GetCapablities 2.0.0' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WFS Get GetCapabilities Request 2.0.0 does not match what\'s expected. URL: ' + req_url)
def test_request_wms_layer_error(self): """ 11. Request erroneous layer via WMS """ ref_hash = '76453fe3c6c2490243d41595c964b2e8' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270' if DEBUG: print '\nTesting: Request erroneous layer via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'Request erroneous layer via WMS does not match what\'s expected. URL: ' + req_url)
def test_wms_get_capabilities_1_3_0(self): """ 9. Request WMS GetCapabilities 1.3.0 """ ref_hash = '7021210da004e005602bccb6b4460c59' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities' if DEBUG: print '\nTesting WMS GetCapablities 1.3.0' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMS Get GetCapabilities Request 1.3.0 does not match what\'s expected. URL: ' + req_url)
def test_wms_get_capabilities_1_1_1(self): """ 8. Request WMS GetCapabilities 1.1.1 """ ref_hash = 'bcfb8df956e848705a4a76035a560460' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities' if DEBUG: print '\nTesting WMS GetCapablities 1.1.1' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMS Get GetCapabilities 1.1.1 Request does not match what\'s expected. URL: ' + req_url)
def test_request_wms_date_from_noyear_layer(self): """ 6. Request tile with date from "non-year" layer via WMS """ ref_hash = '7c995c069a1a0325b9eba00470227613' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=test_nonyear_jpg&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&TIME=2012-02-29' if DEBUG: print '\nTesting: Request tile with date from "non-year layer via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMS date request from "non-year" layer does not match what\'s expected. URL: ' + req_url)
def test_request_wms_from_vector(self): """ 21. Request image from vector source file with time via WMS """ ref_hash = 'e014ec400b5807dc04cc8dbb5d9cebee' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Terra_Orbit_Dsc_Dots&CRS=EPSG%3A4326&STYLES=&WIDTH=1024&HEIGHT=512&BBOX=-180,-90,180,90&TIME=2016-03-05' if DEBUG: print '\nTesting: Request image from vector source file with time via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMS request from vector layer does not match what\'s expected. URL: ' + req_url)
def test_request_wms_datesnap(self): """ 13. Request tile with multi-day period and snap to available date via WMS """ ref_hash = '3b38bef10ecb5302a3e937cd8aceac67' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=snap_test_3a&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&TIME=2015-01-15' if DEBUG: print '\nTesting: Request tile with multi-day period and snap to available date via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMS tile with multi-day period and snap to available date does not match what\'s expected. URL: ' + req_url)
def test_request_wfs_geojson_with_time(self): """ 24. Request GeoJSON from vector source file with time via WFS """ ref_hash = 'd28dab255366e4bf69d8eaf6d649d930' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TYPENAME=Terra_Orbit_Dsc_Dots&OUTPUTFORMAT=geojson&TIME=2016-03-05' if DEBUG: print '\nTesting: Request GeoJSON from vector source file with time via WFS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMS request GeoJSON from vector source file with time via WFS does not match what\'s expected. URL: ' + req_url)
def test_request_wms_datesnap_multilayer(self): """ 14. Request multiple layers with multi-day period and snap to available date via WMS """ ref_hash = 'ea527f46b4c8218294428249e27fc060' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=snap_test_3a,snap_test_3b&map.layer[snap_test_3b]=OPACITY+50&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&TIME=2015-12-15' if DEBUG: print '\nTesting: Request multiple layers with multi-day period and snap to available date via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMS multiple layers with multi-day period and snap to available date does not match what\'s expected. URL: ' + req_url)
def test_request_twms_notime_jpg(self): """ 5. Request current (no time) JPEG tile via TWMS """ ref_hash = '3f84501587adfe3006dcbf59e67cd0a3' req_url = 'http://localhost/onearth/test/twms/twms.cgi?request=GetMap&layers=test_weekly_jpg&srs=EPSG:4326&format=image%2Fjpeg&styles=&&width=512&height=512&bbox=-180,-198,108,90' if DEBUG: print '\nTesting: Request current (no TIME) JPG tile via TWMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'TWMS current JPG request does not match what\'s expected. URL: ' + req_url)
def test_request_wms_datesnap_some_layers_outofrange(self): """ 16. Request multiple layers with multi-day period and snap to date that is out of range for one of the layers via WMS """ ref_hash = '3b38bef10ecb5302a3e937cd8aceac67' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=snap_test_3a,snap_test_3b&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&TIME=2016-03-02' if DEBUG: print '\nTesting: Request multiple layers with multi-day period and snap to date that is out of range for one of the layers via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMS multiple layers with multi-day period and snap to date that is out of range for one of the layers does not match what\'s expected. URL: ' + req_url)
def test_request_wms_date_from_year_layer(self): """ 5. Request tile with date from "year" layer via WMS """ ref_hash = 'cbf79a63d8a539bf7769eded5538fe9d' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=test_weekly_jpg&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&time=2012-02-22' if DEBUG: print '\nTesting: Request tile with date from "year" layer via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMS date request from "year" layer does not match what\'s expected. URL: ' + req_url)
def test_request_static_notime(self): """ 12. Request tile from static layer with no time via WMTS """ ref_hash = '3f84501587adfe3006dcbf59e67cd0a3' req_url = 'http://localhost/onearth/test/wmts/wmts.cgi?layer=test_static_jpg&tilematrixset=EPSG4326_16km&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix=0&TileCol=0&TileRow=0' if DEBUG: print '\nTesting: Request tile from static layer with no time via WMTS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'WMTS static notime request does not match what\'s expected. URL: ' + req_url)
def test_request_wmts_no_time_png(self): """ 2 .Request current (no time) PNG tile via WMTS """ ref_hash = '944c7ce9355cb0aa29930dc16ab03db6' req_url = 'http://localhost/onearth/test/wmts/wmts.cgi?layer=test_daily_png&tilematrixset=EPSG4326_16km&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix=0&TileCol=0&TileRow=0' # Debug message (if DEBUG is set) if DEBUG: print '\nTesting: Request current (no time) PNG tile via WMTS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue(check_result, 'Current (no TIME) WMTS PNG Tile Request does not match what\'s expected. URL: ' + req_url)
def test_REST_API(self): """ 20. WMTS REST requests """ params = (('3f84501587adfe3006dcbf59e67cd0a3', 'http://localhost/onearth/test/wmts/test_weekly_jpg/default/2012-02-29/EPSG4326_16km/0/0/0.jpeg'), ('9dc7e0fe96613fdb2d9855c3669ba524', 'http://localhost/onearth/test/wmts/test_weekly_jpg/default/2012-02-29/EPSG4326_16km/0/0/1.jpeg')) if DEBUG: print '\nTesting REST API' for ref_hash, url in params: if DEBUG: print 'Using URL ' + url check_result = check_tile_request(url, ref_hash) self.assertTrue(check_result, 'REST API request does not match what\'s expected: ' + url)
def test_request_wms_badtimeformat(self): """ 28. Request multiple layers with bad time format via WMS """ ref_hash = '15bfb2f8a156a407e746268688a1cf31' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=snap_test_3a,snap_test_3b&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&TIME=2016-03-02T23:30:59' if DEBUG: print '\nTesting: Request multiple layers bad time format via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMS multiple layers bad time format does not match what\'s expected. URL: ' + req_url)
def test_request_wms_baddate(self): """ 26. Request multiple layers with bad date via WMS """ ref_hash = '7a381e294d85fe36d69d61a981da8147' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=snap_test_3a,snap_test_3b&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&TIME=2016-11-31' if DEBUG: print '\nTesting: Request multiple layers bad date via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMS multiple layers bad date does not match what\'s expected. URL: ' + req_url)
def test_request_wfs_csv_with_time(self): """ 25. Request CSV from vector source file with time via WFS """ ref_hash = '416ff6eeedf4150c358bdade4994718f' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TYPENAME=Terra_Orbit_Dsc_Dots&OUTPUTFORMAT=csv&TIME=2016-03-05' if DEBUG: print '\nTesting: Request CSV from vector source file with time via WFS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMS request CSV from vector source file with time via WFS does not match what\'s expected. URL: ' + req_url)
def test_request_wfs_geojson_with_time(self): """ 24. Request GeoJSON from vector source file with time via WFS """ ref_hash = 'd28dab255366e4bf69d8eaf6d649d930' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&TYPENAME=Terra_Orbit_Dsc_Dots&OUTPUTFORMAT=geojson&TIME=2016-03-05' if DEBUG: print '\nTesting: Request GeoJSON from vector source file with time via WFS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMS request GeoJSON from vector source file with time via WFS does not match what\'s expected. URL: ' + req_url)
def test_request_wms_from_vector(self): """ 21. Request image from vector source file with time via WMS """ ref_hash = 'e014ec400b5807dc04cc8dbb5d9cebee' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=Terra_Orbit_Dsc_Dots&CRS=EPSG%3A4326&STYLES=&WIDTH=1024&HEIGHT=512&BBOX=-180,-90,180,90&TIME=2016-03-05' if DEBUG: print '\nTesting: Request image from vector source file with time via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMS request from vector layer does not match what\'s expected. URL: ' + req_url)
def test_wfs_get_capabilities_2_0_0(self): """ 10. Request WFS GetCapabilities 2.0.0 """ ref_hash = '74541c28d6b94185c1139073b309dd29' req_url = 'http://localhost/onearth/test/wfs/mapserv?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetCapabilities' if DEBUG: print '\nTesting WFS GetCapablities 2.0.0' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WFS Get GetCapabilities Request 2.0.0 does not match what\'s expected. URL: ' + req_url)
def test_request_wms_default_time_png(self): """ 4. Request current (time=default) PNG tile via WMS """ ref_hash = '7c995c069a1a0325b9eba00470227613' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=test_static_jpg&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&TIME=default' if DEBUG: print '\nTesting: Request current (time=default) PNG tile via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'Request current (time=default) PNG tile via WMS does not match what\'s expected. URL: ' + req_url)
def test_request_wms_reprojection(self): """ 18. Request layer with date and reproject from EPSG:4326 to EPSG:3857 via WMS """ ref_hash = '50843cf95d86d9139643f9fcd1d048ec' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=test_weekly_jpg&CRS=EPSG%3A3857&STYLES=&WIDTH=1280&HEIGHT=1280&BBOX=-20037508.34,-20037508.34,20037508.34,20037508.34&time=2012-02-22' if DEBUG: print '\nTesting: Request layer with date and reproject from EPSG:4326 to EPSG:3857' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMS request layer with date and reproject from EPSG:4326 to EPSG:3857 does not match what\'s expected. URL: ' + req_url)
def test_request_wms_datesnap_some_layers_outofrange(self): """ 16. Request multiple layers with multi-day period and snap to date that is out of range for one of the layers via WMS """ ref_hash = 'b1c9cb360c0d78b41b88fb4ddc8d42dc' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=snap_test_3a,snap_test_3b&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&TIME=2016-03-02' if DEBUG: print '\nTesting: Request multiple layers with multi-day period and snap to date that is out of range for one of the layers via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMS multiple layers with multi-day period and snap to date that is out of range for one of the layers does not match what\'s expected. URL: ' + req_url)
def test_request_wms_datesnap_multilayer(self): """ 14. Request multiple layers with multi-day period and snap to available date via WMS """ ref_hash = 'ea527f46b4c8218294428249e27fc060' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=snap_test_3a,snap_test_3b&map.layer[snap_test_3b]=OPACITY+50&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&TIME=2015-12-15' if DEBUG: print '\nTesting: Request multiple layers with multi-day period and snap to available date via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMS multiple layers with multi-day period and snap to available date does not match what\'s expected. URL: ' + req_url)
def test_request_wms_datesnap(self): """ 13. Request tile with multi-day period and snap to available date via WMS """ ref_hash = '3b38bef10ecb5302a3e937cd8aceac67' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=snap_test_3a&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&TIME=2015-01-15' if DEBUG: print '\nTesting: Request tile with multi-day period and snap to available date via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMS tile with multi-day period and snap to available date does not match what\'s expected. URL: ' + req_url)
def test_request_wms_datetime_with_regular_time(self): """ 12. Request tile with date and time (sub-daily) and another layer with YYYY-MM-DD time via WMS """ ref_hash = '93fccd7bcd34f4ff179498c09b4876e8' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=test_weekly_jpg,test_legacy_subdaily_jpg&map.layer[test_legacy_subdaily_jpg]=OPACITY+50&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&TIME=2012-02-29T12:00:00Z' if DEBUG: print '\nTesting: Request tile with date and time (sub-daily) and another layer with YYYY-MM-DD time via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMS tile with date and time (sub-daily) and another layer with YYYY-MM-DD time does not match what\'s expected. URL: ' + req_url)
def test_request_wms_layer_error(self): """ 11. Request erroneous layer via WMS """ ref_hash = '35a5f708101eb4a452d9cc3da3adb5e4' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=blah&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270' if DEBUG: print '\nTesting: Request erroneous layer via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'Request erroneous layer via WMS does not match what\'s expected. URL: ' + req_url)
def test_request_wms_no_layer_error(self): """ 29. Request missing layers via WMS """ ref_hash = '28b9e89643766a3b6cfe80029d349f24' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270' if DEBUG: print '\nTesting: Request missing layers via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'Request missing layers via WMS does not match what\'s expected. URL: ' + req_url)
def test_twms_get_capabilities(self): """ 15. Request TWMS GetCapabilities """ ref_hash = '8c40cc837b6ad1f27209f2243241fba6' req_url = 'http://localhost/onearth/test/twms/twms.cgi?Request=GetCapabilities' if DEBUG: print '\nTesting TWMS GetCapablities' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'TWMS Get GetCapabilities Request does not match what\'s expected. URL: ' + req_url)
def test_request_wms_reprojection_multilayer(self): """ 19. Request multiple layers and reproject from EPSG:4326 to EPSG:3857 via WMS """ ref_hash = 'cc013129f771402ccf443ff729e3fe52' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=test_static_jpg,snap_test_3a,snap_test_3b&map.layer[snap_test_3a]=OPACITY+50&map.layer[snap_test_3b]=OPACITY+50&CRS=EPSG:3857&STYLES=&WIDTH=1280&HEIGHT=1280&BBOX=-20037508.34,-20037508.34,20037508.34,20037508.34&TIME=2015-01-01' if DEBUG: print '\nTesting: Request multiple layers and reproject from EPSG:4326 to EPSG:3857 via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMS multiple layers and reproject from EPSG:4326 to EPSG:3857 does not match what\'s expected. URL: ' + req_url)
def test_request_wms_subdaily_timesnap(self): """ 20. Request tile with time (sub-daily) and snap to available date time via WMS """ ref_hash = 'dbb24bb1dcb5346de0a44523040d0b93' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=test_legacy_subdaily_jpg&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&TIME=2012-02-29T12:00:00Z' if DEBUG: print '\nTesting: Request tile with date and time (sub-daily) and another layer with YYYY-MM-DD time via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMS tile with date and time (sub-daily) and another layer with YYYY-MM-DD time does not match what\'s expected. URL: ' + req_url)
def test_wms_get_capabilities_1_3_0(self): """ 9. Request WMS GetCapabilities 1.3.0 """ ref_hash = 'dfbd4b79796c78db32df08eddc8ff14c' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities' if DEBUG: print '\nTesting WMS GetCapablities 1.3.0' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMS Get GetCapabilities Request 1.3.0 does not match what\'s expected. URL: ' + req_url)
def test_request_wms_date_from_year_layer(self): """ 5. Request tile with date from "year" layer via WMS """ ref_hash = 'cbf79a63d8a539bf7769eded5538fe9d' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=test_weekly_jpg&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&time=2012-02-22' if DEBUG: print '\nTesting: Request tile with date from "year" layer via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMS date request from "year" layer does not match what\'s expected. URL: ' + req_url)
def test_twms_get_tile_service(self): """ 16. Request TWMS GetTileService """ ref_hash = 'da3cb2220b89418ed78f04ce610d9703' req_url = 'http://localhost/onearth/test/twms/twms.cgi?Request=GetTileService' if DEBUG: print '\nTesting WMTS GetTileService' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'TWMS Get GetTileService Request does not match what\'s expected. URL: ' + req_url)
def test_request_wmts_year_zlevel(self): """ 10. Request tile with date and time (z-level) from "year" layer via WMTS """ ref_hash = '36bb79a33dbbe6173990103a8d6b67cb' req_url = 'http://localhost/onearth/test/wmts/wmts.cgi?layer=test_zindex_jpg&tilematrixset=EPSG4326_16km&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix=0&TileCol=0&TileRow=0&TIME=2012-02-29T16:00:00Z' if DEBUG: print '\nTesting: Request tile with date and time (z-level) from "year" layer via WMTS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMTS Z-Level JPG Tile Request does not match what\'s expected. URL: ' + req_url)
def test_request_twms_date_png(self): """ 13. Request tile with date via TWMS """ ref_hash = '944c7ce9355cb0aa29930dc16ab03db6' req_url = 'http://localhost/onearth/test/twms/twms.cgi?request=GetMap&layers=test_daily_png&srs=EPSG:4326&format=image%2Fpng&styles=&&width=512&height=512&bbox=-180,-198,108,90&TIME=2012-02-29' if DEBUG: print '\nTesting: Request tile with date via TWMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'TWMS PNG request with date does not match what\'s expected. URL: ' + req_url)
def test_request_wmts_legacy_datetime_from_year_layer(self): """ 9. Request tile with date and time (sub-daily) from "year" layer via WMTS """ ref_hash = '5a39c4e335d05295160a7bec4961002d' req_url = 'http://localhost/onearth/test/wmts/wmts.cgi?layer=test_legacy_subdaily_jpg&tilematrixset=EPSG4326_16km&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix=0&TileCol=0&TileRow=0&TIME=2012-02-29T12:00:00Z' if DEBUG: print '\nTesting: Request tile with date and time (legacy sub-daily) from "year" layer via WMTS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMTS legacy subdaily request does not match what\'s expected. URL: ' + req_url)
def test_wmts_get_capabilities(self): """ 14. Request WMTS GetCapabilities """ ref_hash = 'c60c6dd540a40a8deba037bcb70ea3ce' req_url = 'http://localhost/onearth/test/wmts/wmts.cgi?Request=GetCapabilities' if DEBUG: print '\nTesting WMTS GetCapablities' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WTMTS Get GetCapabilities Request does not match what\'s expected. URL: ' + req_url)
def test_request_wms_date_from_noyear_layer(self): """ 6. Request tile with date from "non-year" layer via WMS """ ref_hash = '7c995c069a1a0325b9eba00470227613' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=test_nonyear_jpg&CRS=EPSG%3A4326&STYLES=&WIDTH=1536&HEIGHT=636&BBOX=-111.796875%2C-270%2C111.796875%2C270&TIME=2012-02-29' if DEBUG: print '\nTesting: Request tile with date from "non-year layer via WMS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMS date request from "non-year" layer does not match what\'s expected. URL: ' + req_url)
def test_request_static_notime(self): """ 12. Request tile from static layer with no time via WMTS """ ref_hash = '3f84501587adfe3006dcbf59e67cd0a3' req_url = 'http://localhost/onearth/test/wmts/wmts.cgi?layer=test_static_jpg&tilematrixset=EPSG4326_16km&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix=0&TileCol=0&TileRow=0' if DEBUG: print '\nTesting: Request tile from static layer with no time via WMTS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMTS static notime request does not match what\'s expected. URL: ' + req_url)
def test_wms_get_capabilities_1_1_1(self): """ 8. Request WMS GetCapabilities 1.1.1 """ ref_hash = '91d5f50860dc4324a805791191683588' req_url = 'http://localhost/onearth/test/wms/mapserv?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities' if DEBUG: print '\nTesting WMS GetCapablities 1.1.1' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMS Get GetCapabilities 1.1.1 Request does not match what\'s expected. URL: ' + req_url)
def test_request_wmts_date_from_noyear_layer(self): """ 8. Request tile with date from "non-year" layer via WMTS """ ref_hash = '3f84501587adfe3006dcbf59e67cd0a3' req_url = 'http://localhost/onearth/test/wmts/wmts.cgi?layer=test_nonyear_jpg&tilematrixset=EPSG4326_16km&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix=0&TileCol=0&TileRow=0&TIME=2012-02-29' if DEBUG: print '\nTesting: Request tile with date from "non-year layer via WMTS' print 'URL: ' + req_url check_result = check_tile_request(req_url, ref_hash) self.assertTrue( check_result, 'WMTS date request from "non-year" layer does not match what\'s expected. URL: ' + req_url)