[tilestache] 16/22: Enable tests with nose.
Bas Couwenberg
sebastic at debian.org
Thu Oct 27 21:40:31 UTC 2016
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch master
in repository tilestache.
commit 70df32608c158760121c2c49255995a49ae8f7ce
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Thu Oct 27 17:53:09 2016 +0200
Enable tests with nose.
---
debian/changelog | 1 +
debian/control | 9 +++++-
debian/patches/series | 1 +
debian/patches/skip-tests.patch | 68 +++++++++++++++++++++++++++++++++++++++++
debian/rules | 4 +++
5 files changed, 82 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index ac930b8..bb6d5b1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,7 @@ tilestache (1.51.2-1) UNRELEASED; urgency=medium
* Update dependencies for new upstream release.
* Refresh patches.
* Include API.html in docs, other docs removed upstream.
+ * Enable tests with nose.
-- Bas Couwenberg <sebastic at debian.org> Thu, 27 Oct 2016 17:15:15 +0200
diff --git a/debian/control b/debian/control
index 3ee6fb3..b7c9008 100644
--- a/debian/control
+++ b/debian/control
@@ -7,8 +7,15 @@ Priority: extra
Build-Depends: debhelper (>= 9~),
dh-python,
python-all (>= 2.6.6-3~),
+ python-gdal,
+ python-modestmaps (>= 1.3.0),
+ python-pkg-resources,
+ python-mapbox-vector-tile,
+ python-memcache,
+ python-nose,
python-setuptools,
- python-pkg-resources
+ python-shapely,
+ python-werkzeug
Standards-Version: 3.9.6
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-grass/tilestache.git
Vcs-Git: https://anonscm.debian.org/git/pkg-grass/tilestache.git
diff --git a/debian/patches/series b/debian/patches/series
index 0b75c5e..8fbd8ed 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@
03-use_system_modestmaps.patch
04-fix_for_newer_modestmaps.patch
pillow-3.0.0.patch
+skip-tests.patch
diff --git a/debian/patches/skip-tests.patch b/debian/patches/skip-tests.patch
new file mode 100644
index 0000000..1f10a33
--- /dev/null
+++ b/debian/patches/skip-tests.patch
@@ -0,0 +1,68 @@
+Description: Skip tests requiring network and other unmet prerequisites.
+Author: Bas Couwenberg <sebastic at debian.org>
+
+--- a/tests/vector_tests.py
++++ b/tests/vector_tests.py
+@@ -1,5 +1,6 @@
+-from unittest import TestCase
++from unittest import TestCase, skipIf
+ import json
++import os
+
+ from osgeo import ogr
+ from shapely.geometry import Point, LineString, Polygon, MultiPolygon, asShape
+@@ -11,6 +12,7 @@ from . import utils
+ # If you want to run them locally, create a similar PostGIS database.
+ # Look at .travis.yml for details.
+
++ at skipIf('NO_DATABASE' in os.environ, "No database tests requested")
+ class PostGISVectorTestBase(object):
+ '''
+ Base Class for PostGIS Vector tests. Has methods to:
+--- a/tests/cache_tests.py
++++ b/tests/cache_tests.py
+@@ -1,7 +1,9 @@
+-from unittest import TestCase
++from unittest import TestCase, skipIf
+ from . import utils
+ import memcache
++import os
+
++ at skipIf('OFFLINE_TESTS' in os.environ, "Offline tests only")
+ class CacheTests(TestCase):
+ '''Tests various Cache configurations that reads from cfg file'''
+
+--- a/tests/provider_tests.py
++++ b/tests/provider_tests.py
+@@ -1,8 +1,10 @@
+ # This Python file uses the following encoding: utf-8
++import os
+
+-from unittest import TestCase
++from unittest import TestCase, skipIf
+ from . import utils
+
++ at skipIf('OFFLINE_TESTS' in os.environ, "Offline tests only")
+ class ProviderTests(TestCase):
+ '''Tests Proxy Provider that reads from cfg file'''
+
+--- a/tests/vectiles_tests.py
++++ b/tests/vectiles_tests.py
+@@ -1,7 +1,8 @@
+-from unittest import TestCase
++from unittest import TestCase, skipIf
+ from collections import namedtuple
+ from math import hypot
+ import json
++import os
+
+ from osgeo import ogr, osr
+ from shapely.geometry import Point, LineString, Polygon, MultiPolygon, asShape
+@@ -144,6 +145,7 @@ class PostGISVectorTestBase(object):
+ self.conn.ExecuteSQL('DROP TABLE if exists %s' % (self.testTableName,))
+
+
++ at skipIf('NO_DATABASE' in os.environ, "No database tests requested")
+ class VectorProviderTest(PostGISVectorTestBase, TestCase):
+ '''Various vectiles tests on top of PostGIS'''
+
diff --git a/debian/rules b/debian/rules
index b734d8d..44163a0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,6 +5,7 @@
#export DH_VERBOSE=1
export PYBUILD_NAME=TileStache
+export PYBUILD_TEST_NOSE=1
PREFIX := $(CURDIR)/debian/tilestache/
@@ -13,6 +14,9 @@ PREFIX := $(CURDIR)/debian/tilestache/
--with python2 \
--buildsystem pybuild
+override_dh_auto_test:
+ OFFLINE_TESTS=1 NO_DATABASE=1 dh_auto_test
+
override_dh_auto_install:
dh_auto_install
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/tilestache.git
More information about the Pkg-grass-devel
mailing list