示例#1
0
文件: test.py 项目: bentano/heatmap
    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)
示例#2
0
    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)
示例#3
0
文件: test.py 项目: bentano/heatmap
    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)
示例#4
0
    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)
示例#5
0
文件: test.py 项目: bentano/heatmap
    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)
示例#6
0
    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)