[mapproxy] 07/09: Add patch to skip tests when data files are missing.

Bas Couwenberg sebastic at debian.org
Thu May 18 18:12:02 UTC 2017


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository mapproxy.

commit 764bc031992bd9cda676f1ddc1bb2dd7af8d4602
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Thu May 18 19:32:29 2017 +0200

    Add patch to skip tests when data files are missing.
---
 debian/changelog                                  |  1 +
 debian/patches/offline-tests.patch                | 22 +++++++-
 debian/patches/series                             |  1 +
 debian/patches/skip-tests-for-missing-files.patch | 67 +++++++++++++++++++++++
 4 files changed, 90 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index d654a0f..3b69537 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ mapproxy (1.10.0-1) UNRELEASED; urgency=medium
   * Add python{,3}-redis to (build) dependencies.
   * Drop patches applied upstream.
   * Update mapproxy-seed manpage for new options.
+  * Add patch to skip tests when data files are missing.
 
  -- Bas Couwenberg <sebastic at debian.org>  Thu, 18 May 2017 18:36:20 +0200
 
diff --git a/debian/patches/offline-tests.patch b/debian/patches/offline-tests.patch
index a334461..5cfb495 100644
--- a/debian/patches/offline-tests.patch
+++ b/debian/patches/offline-tests.patch
@@ -1,6 +1,6 @@
 Description: Disable tests that require network.
 Author: Bas Couwenberg <sebastic at debian.org>
-Forwarded: https://github.com/mapproxy/mapproxy/pull/246
+Forwarded: not-needed
 
 --- a/mapproxy/test/system/test_util_wms_capabilities.py
 +++ b/mapproxy/test/system/test_util_wms_capabilities.py
@@ -298,3 +298,23 @@ Forwarded: https://github.com/mapproxy/mapproxy/pull/246
          error_handler = HTTPSourceErrorHandler()
          error_handler.add_handler(500, (255, 0, 0), cacheable=False)
          error_handler.add_handler(204, (255, 0, 127, 200), cacheable=True)
+--- a/mapproxy/test/system/test_seed.py
++++ b/mapproxy/test/system/test_seed.py
+@@ -32,6 +32,7 @@ from mapproxy.test.http import mock_http
+ from mapproxy.test.image import tmp_image, create_tmp_image_buf, create_tmp_image
+ 
+ from nose.tools import eq_
++from nose.plugins.skip import SkipTest
+ 
+ FIXTURE_DIR = os.path.join(os.path.dirname(__file__), 'fixture')
+ 
+@@ -357,6 +358,9 @@ class TestConcurrentRequestsSeed(SeedTes
+     empty_ogrdata = 'empty_ogrdata.geojson'
+ 
+     def test_timeout(self):
++        if 'OFFLINE_TESTS' in os.environ:
++            raise SkipTest
++
+         # test concurrent seeding where seed concurrency is higher than the permitted
+         # concurrent_request value of the source and a lock times out
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 1d69a20..5c20cd0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 offline-tests.patch
 disable-tag_date.patch
+skip-tests-for-missing-files.patch
diff --git a/debian/patches/skip-tests-for-missing-files.patch b/debian/patches/skip-tests-for-missing-files.patch
new file mode 100644
index 0000000..d964bd3
--- /dev/null
+++ b/debian/patches/skip-tests-for-missing-files.patch
@@ -0,0 +1,67 @@
+Description: Skip tests for missing data files.
+Author: Bas Couwenberg <sebastic at debian.org>
+Forwarded: not-needed
+
+--- a/mapproxy/test/system/test_cache_geopackage.py
++++ b/mapproxy/test/system/test_cache_geopackage.py
+@@ -27,6 +27,7 @@ from mapproxy.test.system import prepare
+ from mapproxy.cache.geopackage import GeopackageCache
+ from mapproxy.grid import TileGrid
+ from nose.tools import eq_
++from nose.plugins.skip import SkipTest
+ import sqlite3
+ 
+ test_config = {}
+@@ -35,6 +36,9 @@ test_config = {}
+ def setup_module():
+     prepare_env(test_config, 'cache_geopackage.yaml')
+ 
++    if not os.path.exists(os.path.join(test_config['fixture_dir'], 'cache.gpkg')):
++        raise SkipTest
++
+     shutil.copy(os.path.join(test_config['fixture_dir'], 'cache.gpkg'),
+         test_config['base_dir'])
+     create_app(test_config)
+--- a/mapproxy/test/unit/test_cache_geopackage.py
++++ b/mapproxy/test/unit/test_cache_geopackage.py
+@@ -29,6 +29,7 @@ from mapproxy.grid import tile_grid, Til
+ from mapproxy.test.unit.test_cache_tile import TileCacheTestBase
+ 
+ from nose.tools import eq_
++from nose.plugins.skip import SkipTest
+ 
+ class TestGeopackageCache(TileCacheTestBase):
+ 
+@@ -190,6 +191,10 @@ class TestGeopackageCacheInitErrors(obje
+                                                               'fixture'),
+                                  'cache.gpkg')
+         table_name = 'cache'
++
++        if not os.path.exists(gpkg_file):
++            raise SkipTest
++
+         try:
+             GeopackageCache(gpkg_file, TileGrid(srs=4326), table_name)
+         except ValueError as ve:
+@@ -202,6 +207,10 @@ class TestGeopackageCacheInitErrors(obje
+                                                               'fixture'),
+                                  'cache.gpkg')
+         table_name = 'cache'
++
++        if not os.path.exists(gpkg_file):
++            raise SkipTest
++
+         try:
+             GeopackageCache(gpkg_file, TileGrid(srs=900913, tile_size=(512, 512)), table_name)
+         except ValueError as ve:
+@@ -214,6 +223,10 @@ class TestGeopackageCacheInitErrors(obje
+                                               'fixture'),
+                                  'cache.gpkg')
+         table_name = 'cache'
++
++        if not os.path.exists(gpkg_file):
++            raise SkipTest
++
+         try:
+             GeopackageCache(gpkg_file, TileGrid(srs=900913, res=[1000, 100, 10]), table_name)
+         except ValueError as ve:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/mapproxy.git



More information about the Pkg-grass-devel mailing list