File: layer_test.py

package info (click to toggle)
python-mapnik 1%3A0.0~20200224-7da019cf9-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 10,784 kB
  • sloc: python: 12,085; cpp: 5,717; sh: 101; makefile: 18
file content (33 lines) | stat: -rw-r--r-- 802 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from nose.tools import eq_

import mapnik

from .utilities import run_all


# Map initialization


def test_layer_init():
    l = mapnik.Layer('test')
    eq_(l.name, 'test')
    eq_(l.srs, '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs')
    eq_(l.envelope(), mapnik.Box2d())
    eq_(l.clear_label_cache, False)
    eq_(l.cache_features, False)
    eq_(l.visible(1), True)
    eq_(l.active, True)
    eq_(l.datasource, None)
    eq_(l.queryable, False)
    eq_(l.minimum_scale_denominator, 0.0)
    eq_(l.maximum_scale_denominator > 1e+6, True)
    eq_(l.group_by, "")
    eq_(l.maximum_extent, None)
    eq_(l.buffer_size, None)
    eq_(len(l.styles), 0)

if __name__ == "__main__":
    exit(run_all(eval(x) for x in dir() if x.startswith("test_")))