mapnik/tests/python_tests/datasource_test.py
2009-05-01 01:24:12 +00:00

17 lines
No EOL
474 B
Python

#!/usr/bin/env python
from nose.tools import *
from utilities import execution_path
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_field_listing():
lyr = mapnik.Layer('test')
lyr.datasource = mapnik.Shapefile(file='../data/shp/poly.shp')
fields = lyr.datasource.fields()
eq_(fields, ['AREA', 'EAS_ID', 'PRFEDEA'])