Imports

    >>> from __future__ import (absolute_import, division, print_function)
    >>> from owslib.wms import WebMapService
    >>> from owslib.util import ServiceException

GetMap Tests against live services (pulled from the docstrings)
(images aren't saved)

MESONET
GetMap 1.1.1
    >>> url = 'http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r-t.cgi'
    >>> wms = WebMapService(url, version='1.1.1')
    >>> wms.request
    'http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r-t.cgi?service=WMS&request=GetCapabilities&version=1.1.1'
    >>> rsp = wms.getmap(layers=['nexrad_base_reflect'], styles=['default'], srs='EPSG:4326', bbox=(-126, 24, -66, 50), size=(250, 250), format='image/jpeg', transparent=True)
    >>> type(rsp)
    <class '...ResponseWrapper'>


GetMap 1.1.1 ServiceException for an invalid CRS

    >>> try:
    ...     rsp = wms.getmap(layers=['nexrad_base_reflect'], styles=['default'], srs='EPSG:4328', bbox=(-126, 24, -66, 50), size=(250, 250), format='image/jpeg', transparent=True)
    ... except ServiceException as e:
    ...     assert "msWMSLoadGetMapParams(): WMS server error. Invalid SRS given : SRS must be valid for all requested layers." in str(e)

GetMap 1.3.0

    >>> url = 'http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r-t.cgi'
    >>> wms = WebMapService(url, version='1.3.0')
    >>> rsp = wms.getmap(layers=['nexrad_base_reflect'], styles=['default'], srs='EPSG:4326', bbox=(-126, 24, -66, 50), size=(250, 250), format='image/jpeg', transparent=True)
    >>> type(rsp)
    <class '...ResponseWrapper'>

GetMap 1.3.0 ServiceException for an invalid CRS
    >>> try:
    ...     rsp = wms.getmap(layers=['nexrad_base_reflect'], styles=['default'], srs='EPSG:4328', bbox=(-126, 24, -66, 50), size=(250, 250), format='image/jpeg', transparent=True)
    ... except ServiceException as e:
    ...     assert "msWMSLoadGetMapParams(): WMS server error. Invalid CRS given : CRS must be valid for all requested layers." in str(e)

National Map
    >>> url = 'https://services.nationalmap.gov/ArcGIS/services/geonames/MapServer/WMSServer'
    >>> wms = WebMapService(url, version='1.3.0')
    >>> rsp = wms.getmap(layers=['3'], styles=['default'], srs='CRS:84', bbox=(-176.646, 17.7016, -64.8017, 71.2854), size=(500, 300), format='image/png', transparent=True)
    >>> type(rsp)
    <class '...ResponseWrapper'>
    >>> wms.request
    'https://services.nationalmap.gov/arcgis/services/geonames/MapServer/WmsServer?layers=3&styles=default&service=WMS&crs=CRS%3A84&format=image%2Fpng&request=GetMap&bgcolor=0xFFFFFF&height=300&width=500&version=1.3.0&bbox=-176.646%2C17.7016%2C-64.8017%2C71.2854&exceptions=XML&transparent=TRUE'
