Пример #1
0
    def test_title(self):
        """Test we can set the layer title correctly."""
        layer = load_test_vector_layer('impact',
                                       'buildings_without_style.geojson')

        layer_title(layer)

        # The code tested is running the same logic as the test itself.
        # But at least we have a test.
        exposure_type = layer.keywords['exposure_keywords']['exposure']
        exposure_definitions = definition(exposure_type)
        title = exposure_definitions['layer_legend_title']
        layer.setTitle(title)
        self.assertEqual(title, layer.title())
Пример #2
0
    def test_title(self):
        """Test we can set the layer title correctly."""
        layer = load_test_vector_layer(
            'impact', 'buildings_without_style.geojson')

        layer_title(layer)

        # The code tested is running the same logic as the test itself.
        # But at least we have a test.
        exposure_type = layer.keywords['exposure_keywords']['exposure']
        exposure_definitions = definition(exposure_type)
        title = exposure_definitions['layer_legend_title']
        layer.setTitle(title)
        self.assertEqual(title, layer.title())