Ejemplo n.º 1
0
def setup():
    # make the tests silent to suppress unsupported params from harfbuzz tests
    # TODO: remove this after harfbuzz branch merges
    mapnik.logger.set_severity(mapnik.severity_type.None)
    # All of the paths used are relative, if we run the tests
    # from another directory we need to chdir()
    os.chdir(execution_path('.'))
Ejemplo n.º 2
0
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('.'))
Ejemplo n.º 3
0
def setup():
    os.chdir(execution_path("."))
Ejemplo n.º 4
0
#!/usr/bin/env python

from nose.tools import *
import atexit
import time
from utilities import execution_path, run_all
from subprocess import Popen, PIPE
import os, mapnik
from Queue import Queue
import threading


MAPNIK_TEST_DBNAME = 'mapnik-tmp-postgis-test-db'
POSTGIS_TEMPLATE_DBNAME = 'template_postgis'
SHAPEFILE = os.path.join(execution_path('.'),'../data/shp/world_merc.shp')

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 call(cmd,silent=False):
    stdin, stderr = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
    if not stderr:
        return stdin.strip()
    elif not silent and not 'NOTICE' in stderr:
        raise RuntimeError(stderr.strip())

def psql_can_connect():
    """Test ability to connect to a postgis template db with no options.
Ejemplo n.º 5
0
def setup():
    # make the tests silent since we intentially test error conditions that are noisy
    mapnik.logger.set_severity(mapnik.severity_type.None)
    # All of the paths used are relative, if we run the tests
    # from another directory we need to chdir()
    os.chdir(execution_path('.'))
Ejemplo n.º 6
0
def setup():
    os.chdir(execution_path('.'))
Ejemplo n.º 7
0
        self.centre_x = centre_x
        self.centre_y = centre_y
        self.step = step

    def features(self, query):
        centre = (self.centre_x, self.centre_y)

        return mapnik.PythonDatasource.wkt_features(
            keys = (),
            features = ConcentricCircles(centre, query.bbox, self.step)
        )

if 'python' in mapnik.DatasourceCache.instance().plugin_names():
    # make sure we can load from ourself as a module
    sys.path.append(execution_path('.'))

    def test_python_point_init():
        ds = mapnik.Python(factory='python_plugin_test:PointDatasource')
        e = ds.envelope()

        assert_almost_equal(e.minx, 0, places=7)
        assert_almost_equal(e.miny, -10, places=7)
        assert_almost_equal(e.maxx, 100, places=7)
        assert_almost_equal(e.maxy, 110, places=7)

    def test_python_circle_init():
        ds = mapnik.Python(factory='python_plugin_test:CirclesDatasource')
        e = ds.envelope()

        assert_almost_equal(e.minx, -180, places=7)
#!/usr/bin/env python

from nose.tools import *
import atexit
import time
from utilities import execution_path, run_all
from subprocess import Popen, PIPE
import os, mapnik
from Queue import Queue
import threading


MAPNIK_TEST_DBNAME = "mapnik-tmp-postgis-test-db"
POSTGIS_TEMPLATE_DBNAME = "template_postgis"
SHAPEFILE = os.path.join(execution_path("."), "../data/shp/world_merc.shp")


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 call(cmd, silent=False):
    stdin, stderr = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE).communicate()
    if not stderr:
        return stdin.strip()
    elif not silent and not "NOTICE" in stderr:
        raise RuntimeError(stderr.strip())

Ejemplo n.º 9
0
def setup():
    mapnik.logger.set_severity(mapnik.severity_type.None)
    # All of the paths used are relative, if we run the tests
    # from another directory we need to chdir()
    os.chdir(execution_path('.'))
Ejemplo n.º 10
0
        centre_y = int(centre_y)
        step = int(step)

        self.centre_x = centre_x
        self.centre_y = centre_y
        self.step = step

    def features(self, query):
        centre = (self.centre_x, self.centre_y)

        return mapnik.PythonDatasource.wkt_features(keys=(), features=ConcentricCircles(centre, query.bbox, self.step))


if "python" in mapnik.DatasourceCache.plugin_names():
    # make sure we can load from ourself as a module
    sys.path.append(execution_path("."))

    def test_python_point_init():
        ds = mapnik.Python(factory="python_plugin_test:PointDatasource")
        e = ds.envelope()

        assert_almost_equal(e.minx, 0, places=7)
        assert_almost_equal(e.miny, -10, places=7)
        assert_almost_equal(e.maxx, 100, places=7)
        assert_almost_equal(e.maxy, 110, places=7)

    def test_python_circle_init():
        ds = mapnik.Python(factory="python_plugin_test:CirclesDatasource")
        e = ds.envelope()

        assert_almost_equal(e.minx, -180, places=7)
Ejemplo n.º 11
0
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('.'))
Ejemplo n.º 12
0
def setup():
    # make the tests silent since we intentially test error conditions that are noisy
    mapnik.logger.set_severity(mapnik.severity_type.None)
    # All of the paths used are relative, if we run the tests
    # from another directory we need to chdir()
    os.chdir(execution_path('.'))
Ejemplo n.º 13
0
        self.centre_x = centre_x
        self.centre_y = centre_y
        self.step = step

    def features(self, query):
        centre = (self.centre_x, self.centre_y)

        return mapnik.PythonDatasource.wkt_features(
            keys = (),
            features = ConcentricCircles(centre, query.bbox, self.step)
        )

if 'python' in mapnik.DatasourceCache.plugin_names():
    # make sure we can load from ourself as a module
    sys.path.append(execution_path('.'))

    def test_python_point_init():
        ds = mapnik.Python(factory='python_plugin_test:PointDatasource')
        e = ds.envelope()

        assert_almost_equal(e.minx, 0, places=7)
        assert_almost_equal(e.miny, -10, places=7)
        assert_almost_equal(e.maxx, 100, places=7)
        assert_almost_equal(e.maxy, 110, places=7)

    def test_python_circle_init():
        ds = mapnik.Python(factory='python_plugin_test:CirclesDatasource')
        e = ds.envelope()

        assert_almost_equal(e.minx, -180, places=7)
Ejemplo n.º 14
0
def setup():
    os.chdir(execution_path('.'))
Ejemplo n.º 15
0
#!/usr/bin/env python

from nose.tools import *
import atexit
import time
from utilities import execution_path, run_all
from subprocess import Popen, PIPE
import os, mapnik
from Queue import Queue
import threading

MAPNIK_TEST_DBNAME = 'mapnik-tmp-postgis-test-db'
POSTGIS_TEMPLATE_DBNAME = 'template_postgis'
SHAPEFILE = os.path.join(execution_path('.'), '../data/shp/world_merc.shp')


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 call(cmd, silent=False):
    stdin, stderr = Popen(cmd, shell=True, stdout=PIPE,
                          stderr=PIPE).communicate()
    if not stderr:
        return stdin.strip()
    elif not silent and not 'NOTICE' in stderr:
        raise RuntimeError(stderr.strip())

Ejemplo n.º 16
0
def setup():
    mapnik.logger.set_severity(mapnik.severity_type.None)
    # All of the paths used are relative, if we run the tests
    # from another directory we need to chdir()
    os.chdir(execution_path('.'))