当前位置: 首页>>代码示例>>Python>>正文


Python validator.validate_references函数代码示例

本文整理汇总了Python中mapproxy.config.validator.validate_references函数的典型用法代码示例。如果您正苦于以下问题:Python validate_references函数的具体用法?Python validate_references怎么用?Python validate_references使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了validate_references函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_misconfigured_mapserver_source_without_globals

    def test_misconfigured_mapserver_source_without_globals(self):
        conf = self._test_conf('''
            sources:
                one_source:
                    type: mapserver
                    req:
                        map: foo.map
                    mapserver:
                        binary: /foo/bar/baz
        ''')

        errors = validate_references(conf)
        eq_(errors, [
            'Could not find mapserver binary (/foo/bar/baz)'
        ])

        del conf['sources']['one_source']['mapserver']['binary']

        errors = validate_references(conf)
        eq_(errors, [
            "Missing mapserver binary for source 'one_source'"
        ])

        del conf['sources']['one_source']['mapserver']

        errors = validate_references(conf)
        eq_(errors, [
            "Missing mapserver binary for source 'one_source'"
        ])
开发者ID:Geodan,项目名称:mapproxy,代码行数:29,代码来源:test_conf_validator.py

示例2: test_band_merge_missing_source

    def test_band_merge_missing_source(self):
        conf = self._test_conf('''
            caches:
                one_cache:
                    sources:
                        l:
                            - source: dop
                              band: 1
                              factor: 0.4
                            - source: missing1
                              band: 2
                              factor: 0.2
                            - source: cache_missing_source
                              band: 2
                              factor: 0.2
                    grids: [GLOBAL_MERCATOR]
                cache_missing_source:
                    sources: [missing2]
                    grids: [GLOBAL_MERCATOR]

            sources:
                dop:
                    type: wms
                    req:
                        url: http://localhost/service?
                        layers: dop
        ''')

        errors = validate_references(conf)
        eq_(errors, [
            "Source 'missing1' for cache 'one_cache' not found in config",
            "Source 'missing2' for cache 'cache_missing_source' not found in config",
        ])
开发者ID:Geodan,项目名称:mapproxy,代码行数:33,代码来源:test_conf_validator.py

示例3: test_missing_services_section

 def test_missing_services_section(self):
     conf = self._test_conf()
     del conf['services']
     errors = validate_references(conf)
     eq_(errors, [
         'Missing services section'
     ])
开发者ID:Geodan,项目名称:mapproxy,代码行数:7,代码来源:test_conf_validator.py

示例4: test_missing_cache_source

    def test_missing_cache_source(self):
        conf = self._test_conf()
        del conf['sources']['one_source']

        errors = validate_references(conf)
        eq_(errors, [
            "Source 'one_source' for cache 'one_cache' not found in config"
        ])
开发者ID:Geodan,项目名称:mapproxy,代码行数:8,代码来源:test_conf_validator.py

示例5: test_missing_layers_section

    def test_missing_layers_section(self):
        conf = self._test_conf()
        del conf['layers']

        errors = validate_references(conf)
        eq_(errors, [
            'Missing layers section'
        ])
开发者ID:Geodan,项目名称:mapproxy,代码行数:8,代码来源:test_conf_validator.py

示例6: test_missing_layer_source

    def test_missing_layer_source(self):
        conf = self._test_conf()
        del conf['caches']['one_cache']

        errors = validate_references(conf)
        eq_(errors, [
            "Source 'one_cache' for layer 'one' not in cache or source section"
        ])
开发者ID:Geodan,项目名称:mapproxy,代码行数:8,代码来源:test_conf_validator.py

示例7: test_misconfigured_wms_source

    def test_misconfigured_wms_source(self):
        conf = self._test_conf()

        del conf['sources']['one_source']['req']['layers']

        errors = validate_references(conf)
        eq_(errors, [
            "Missing 'layers' for source 'one_source'"
        ])
开发者ID:Geodan,项目名称:mapproxy,代码行数:9,代码来源:test_conf_validator.py

示例8: test_without_cache

    def test_without_cache(self):
        conf = self._test_conf('''
            layers:
              - name: one
                title: One
                sources: [one_source]
        ''')

        errors = validate_references(conf)
        eq_(errors, [])
开发者ID:Geodan,项目名称:mapproxy,代码行数:10,代码来源:test_conf_validator.py

示例9: test_tile_source

    def test_tile_source(self):
        conf = self._test_conf('''
            layers:
                - name: one
                  tile_sources: [missing]
        ''')

        errors = validate_references(conf)
        eq_(errors, [
            "Tile source 'missing' for layer 'one' not in cache section"
        ])
开发者ID:Geodan,项目名称:mapproxy,代码行数:11,代码来源:test_conf_validator.py

示例10: test_empty_layer_sources

    def test_empty_layer_sources(self):
        conf = self._test_conf('''
            layers:
                - name: one
                  title: One
                  sources: []
        ''')

        errors = validate_references(conf)
        eq_(errors, [
            "Missing sources for layer 'one'"
        ])
开发者ID:Geodan,项目名称:mapproxy,代码行数:12,代码来源:test_conf_validator.py

示例11: test_cascaded_caches

    def test_cascaded_caches(self):
        conf = self._test_conf('''
            caches:
                one_cache:
                    sources: [two_cache]
                two_cache:
                    grids: [GLOBAL_MERCATOR]
                    sources: ['one_source']
        ''')

        errors = validate_references(conf)
        eq_(errors, [])
开发者ID:Geodan,项目名称:mapproxy,代码行数:12,代码来源:test_conf_validator.py

示例12: test_tagged_source_without_layers

    def test_tagged_source_without_layers(self):
        conf = self._test_conf('''
            caches:
                one_cache:
                    grids: [GLOBAL_MERCATOR]
                    sources: ['one_source:foo,bar']
        ''')

        del conf['sources']['one_source']['req']['layers']

        errors = validate_references(conf)
        eq_(errors, [])
开发者ID:Geodan,项目名称:mapproxy,代码行数:12,代码来源:test_conf_validator.py

示例13: test_with_grouped_layer

    def test_with_grouped_layer(self):
        conf = self._test_conf('''
            layers:
                - name: group
                  title: Group
                  layers:
                    - name: one
                      title: One
                      sources: [one_cache]
        ''')

        errors = validate_references(conf)
        eq_(errors, [])
开发者ID:Geodan,项目名称:mapproxy,代码行数:13,代码来源:test_conf_validator.py

示例14: test_tagged_sources_with_layers

    def test_tagged_sources_with_layers(self):
        conf = self._test_conf('''
            caches:
                one_cache:
                    grids: [GLOBAL_MERCATOR]
                    sources: ['one_source:foo,bar']
        ''')

        errors = validate_references(conf)
        eq_(errors, [
            "Supported layers for source 'one_source' are 'one' but tagged source "
            "requested layers 'foo, bar'"
        ])
开发者ID:Geodan,项目名称:mapproxy,代码行数:13,代码来源:test_conf_validator.py

示例15: test_missing_grid

    def test_missing_grid(self):
        conf = self._test_conf('''
            caches:
                one_cache:
                    grids: [MYGRID_OTHERGRID]
            grids:
                MYGRID:
                    base: GLOBAL_GEODETIC
        ''')

        errors = validate_references(conf)
        eq_(errors, [
            "Grid 'MYGRID_OTHERGRID' for cache 'one_cache' not found in config"
        ])
开发者ID:Geodan,项目名称:mapproxy,代码行数:14,代码来源:test_conf_validator.py


注:本文中的mapproxy.config.validator.validate_references函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。