本文整理汇总了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'"
])
示例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",
])
示例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'
])
示例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"
])
示例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'
])
示例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"
])
示例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'"
])
示例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, [])
示例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"
])
示例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'"
])
示例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, [])
示例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, [])
示例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, [])
示例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'"
])
示例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"
])