Best Python code snippet using localstack_python
test_tile_providers.py
Source: test_tile_providers.py
...70 def test_type(self, name) -> None:71 p = getattr(bt, name)72 assert isinstance(p, str)73 def test_url(self, name) -> None:74 p = bt.get_provider(getattr(bt, name))75 assert p.url == _STAMEN_URLS[name]76 def test_attribution(self, name) -> None:77 p = bt.get_provider(getattr(bt, name))78 assert p.attribution == (79 'Map tiles by <a href="https://stamen.com">Stamen Design</a>, '80 'under <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. '81 'Data by <a href="https://openstreetmap.org">OpenStreetMap</a>, '82 'under %s.'83 ) % _STAMEN_LIC[name]84 def test_copies(self, name) -> None:85 p1 = bt.get_provider(getattr(bt, name))86 p2 = bt.get_provider(getattr(bt, name))87 assert p1 is not p288@pytest.mark.parametrize('name', ['CARTODBPOSITRON', 'CARTODBPOSITRON_RETINA'])89class Test_CartoProviders(object):90 def test_type(self, name) -> None:91 p = getattr(bt, name)92 assert isinstance(p, str)93 def test_url(self, name) -> None:94 p = bt.get_provider(getattr(bt, name))95 assert p.url == _CARTO_URLS[name]96 def test_attribution(self, name) -> None:97 p = bt.get_provider(getattr(bt, name))98 assert p.attribution == (99 '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors,'100 '© <a href="https://cartodb.com/attributions">CartoDB</a>'101 )102 def test_copies(self, name) -> None:103 p1 = bt.get_provider(getattr(bt, name))104 p2 = bt.get_provider(getattr(bt, name))105 assert p1 is not p2106@pytest.mark.parametrize('name', ['OSM'])107class Test_OsmProvider(object):108 def test_type(self, name) -> None:109 p = getattr(bt, name)110 assert isinstance(p, str)111 def test_url(self, name) -> None:112 p = bt.get_provider(getattr(bt, name))113 assert p.url == _OSM_URLS[name]114 def test_attribution(self, name) -> None:115 p = bt.get_provider(getattr(bt, name))116 assert p.attribution == (117 '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'118 )119 def test_copies(self, name) -> None:120 p1 = bt.get_provider(getattr(bt, name))121 p2 = bt.get_provider(getattr(bt, name))122 assert p1 is not p2123@pytest.mark.parametrize('name', ['WIKIMEDIA'])124class Test_WikimediaProvider(object):125 def test_type(self, name) -> None:126 p = getattr(bt, name)127 assert isinstance(p, str)128 def test_url(self, name) -> None:129 p = bt.get_provider(getattr(bt, name))130 assert p.url == _WIKIMEDIA_URLS[name]131 def test_attribution(self, name) -> None:132 p = bt.get_provider(getattr(bt, name))133 assert p.attribution == (134 '© <a href="https://foundation.wikimedia.org/wiki/Maps_Terms_of_Use">Wikimedia Maps</a> contributors'135 )136 def test_copies(self, name) -> None:137 p1 = bt.get_provider(getattr(bt, name))138 p2 = bt.get_provider(getattr(bt, name))139 assert p1 is not p2140@pytest.mark.parametrize('name', ['ESRI_IMAGERY'])141class Test_EsriProvider(object):142 def test_type(self, name) -> None:143 p = getattr(bt, name)144 assert isinstance(p, str)145 def test_url(self, name) -> None:146 p = bt.get_provider(getattr(bt, name))147 assert p.url == _ESRI_URLS[name]148 def test_attribution(self, name) -> None:149 p = bt.get_provider(getattr(bt, name))150 assert p.attribution == (151 '© <a href="http://downloads.esri.com/ArcGISOnline/docs/tou_summary.pdf">Esri</a>, '152 'Earthstar Geographics'153 )154 def test_copies(self, name) -> None:155 p1 = bt.get_provider(getattr(bt, name))156 p2 = bt.get_provider(getattr(bt, name))157 assert p1 is not p2158class Test_GetProvider(object):159 @pytest.mark.parametrize('name', ['CARTODBPOSITRON', 'CARTODBPOSITRON_RETINA', 'STAMEN_TERRAIN',160 'STAMEN_TERRAIN_RETINA', 'STAMEN_TONER', 'STAMEN_TONER_BACKGROUND',161 'STAMEN_TONER_LABELS', 'OSM', 'WIKIMEDIA', 'ESRI_IMAGERY', ])162 def test_get_provider(self, name) -> None:163 assert name in bt.Vendors164 enum_member = getattr(bt.Vendors, name)165 assert hasattr(bt, name)166 mod_member = getattr(bt, name)167 p1 = bt.get_provider(enum_member)168 p2 = bt.get_provider(name)169 p3 = bt.get_provider(name.lower())170 p4 = bt.get_provider(mod_member)171 assert isinstance(p1, WMTSTileSource)172 assert isinstance(p2, WMTSTileSource)173 assert isinstance(p3, WMTSTileSource)174 assert isinstance(p4, WMTSTileSource)175 assert p1 is not p2176 assert p2 is not p3177 assert p2 is not p4178 assert p4 is not p1179 assert p1.url == p2.url == p3.url == p4.url180 assert p1.attribution == p2.attribution == p3.attribution == p4.attribution181 def test_unknown_vendor(self) -> None:182 with pytest.raises(ValueError):183 bt.get_provider("This is not a valid tile vendor")184#-----------------------------------------------------------------------------185# Dev API186#-----------------------------------------------------------------------------187#-----------------------------------------------------------------------------188# Private API189#-----------------------------------------------------------------------------190#-----------------------------------------------------------------------------191# Code...
Check out the latest blogs from LambdaTest on this topic:
The fact is not alien to us anymore that cross browser testing is imperative to enhance your application’s user experience. Enhanced knowledge of popular and highly acclaimed testing frameworks goes a long way in developing a new app. It holds more significance if you are a full-stack developer or expert programmer.
QA testers have a unique role and responsibility to serve the customer. Serving the customer in software testing means protecting customers from application defects, failures, and perceived failures from missing or misunderstood requirements. Testing for known requirements based on documentation or discussion is the core of the testing profession. One unique way QA testers can both differentiate themselves and be innovative occurs when senseshaping is used to improve the application user experience.
Having a good web design can empower business and make your brand stand out. According to a survey by Top Design Firms, 50% of users believe that website design is crucial to an organization’s overall brand. Therefore, businesses should prioritize website design to meet customer expectations and build their brand identity. Your website is the face of your business, so it’s important that it’s updated regularly as per the current web design trends.
Enterprise resource planning (ERP) is a form of business process management software—typically a suite of integrated applications—that assists a company in managing its operations, interpreting data, and automating various back-office processes. The introduction of a new ERP system is analogous to the introduction of a new product into the market. If the product is not handled appropriately, it will fail, resulting in significant losses for the business. Most significantly, the employees’ time, effort, and morale would suffer as a result of the procedure.
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!