def test_choose_osm_zoom_with_no_zoom_w_h_in_config(self): # Arrange config = hm.Configuration(use_defaults=True) padding = 2 # Act # Act / Assert with self.assertRaisesRegex(ValueError, "For OSM, you must specify height, " "width, or zoom"): hm.choose_osm_zoom(config, padding)
def test_choose_osm_zoom_with_no_zoom_w_h_in_config(self): # Arrange config = hm.Configuration(use_defaults=True) padding = 2 # Act # Act / Assert with self.assertRaisesRegex( ValueError, "For OSM, you must specify height, " "width, or zoom"): hm.choose_osm_zoom(config, padding)
def test_choose_osm_zoom_with_zoom_in_config(self): # Arrange config = hm.Configuration(use_defaults=True) config.zoom = 2 padding = 2 # Act zoom = hm.choose_osm_zoom(config, padding) # Assert self.assertEqual(zoom, 2)
def test_choose_osm_zoom_with_w_h_in_config(self): # Arrange config = hm.Configuration(use_defaults=True) config.width = 400 config.height = 200 config.extent_in = hm.Extent(coords=(hm.LatLon(-10, -10), hm.LatLon(10, 10))) padding = 2 # Act zoom = hm.choose_osm_zoom(config, padding) # Assert self.assertEqual(zoom, 3)