예제 #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)