File: map_deepcopy_test.py

package info (click to toggle)
mapnik 2.2.0%2Bds1-7
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 30,288 kB
  • ctags: 18,382
  • sloc: cpp: 115,128; python: 9,298; xml: 5,692; ansic: 3,726; makefile: 160; sh: 159; lisp: 13
file content (43 lines) | stat: -rw-r--r-- 1,442 bytes parent folder | download | duplicates (2)
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
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env python

from nose.tools import *
from utilities import execution_path, run_all
from copy import deepcopy

import os, mapnik

def setup():
    # All of the paths used are relative, if we run the tests
    # from another directory we need to chdir()
    os.chdir(execution_path('.'))


#def test_map_deepcopy1():
#    m1 = mapnik.Map(256,256)
#    m1.append_style('style',mapnik.Style())
#    m1.append_fontset('fontset',mapnik.FontSet())
#    m2 = deepcopy(m1)
#    eq_(m2.width, m1.width)
#    eq_(m2.height, m2.height)
#    eq_(m2.srs, m1.srs)
#    eq_(m2.base, m1.base)
#    eq_(m2.background, m1.background)
#    eq_(m2.buffer_size, m1.buffer_size)
#    eq_(m2.aspect_fix_mode, m1.aspect_fix_mode)
#    eq_(m2.envelope(),m1.envelope())
#    eq_(m2.buffered_envelope(),m1.buffered_envelope())
#    eq_(m2.scale(),m1.scale())
#    eq_(m2.scale_denominator(),m1.scale_denominator())
#    eq_(m2.maximum_extent,m1.maximum_extent)
#    eq_(id(m2.view_transform()),id(m1.view_transform()))
#    eq_(id(m2.parameters),id(m1.parameters))
#    eq_(id(m2.layers),id(m1.layers))
#    eq_(id(m2.layers),id(m1.layers))
#    eq_(id(m2.find_fontset('fontset')),id(m2.find_fontset('fontset')))
#    # fails for some reason on linux (not osx)
#    # but non-critical for now
#    #eq_(id(m2.find_style('style')),id(m2.find_style('style')))

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