[python-osmapi] 07/08: Add patch to skip test requiring network.

Bas Couwenberg sebastic at debian.org
Tue Sep 5 20:55:19 UTC 2017


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

sebastic pushed a commit to branch master
in repository python-osmapi.

commit 3ce4a5c8d3f72b361e11a75e30e0b95cb604ce4f
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Tue Sep 5 22:35:19 2017 +0200

    Add patch to skip test requiring network.
---
 debian/changelog                   |  1 +
 debian/patches/offline-tests.patch | 23 +++++++++++++++++++++++
 debian/patches/series              |  1 +
 debian/rules                       |  2 +-
 4 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 562dae4..79476eb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ python-osmapi (1.0.0-1) UNRELEASED; urgency=medium
   * Add python{,3}-httpretty to build dependencies.
   * Bump Standards-Version to 4.0.0, no changes.
   * Add autopkgtest to test installability.
+  * Add patch to skip test requiring network.
 
  -- Bas Couwenberg <sebastic at debian.org>  Tue, 05 Sep 2017 22:07:38 +0200
 
diff --git a/debian/patches/offline-tests.patch b/debian/patches/offline-tests.patch
new file mode 100644
index 0000000..b7db37d
--- /dev/null
+++ b/debian/patches/offline-tests.patch
@@ -0,0 +1,23 @@
+Description: Skip tests when OFFLINE_TESTS env var is set.
+Author: Bas Couwenberg <sebastic at debian.org>
+Bug: https://github.com/metaodi/osmapi/issues/80
+
+--- a/tests/functional_tests.py
++++ b/tests/functional_tests.py
+@@ -1,11 +1,16 @@
+ import httpretty
+ import unittest
+ import osmapi
++import os
+ 
++from nose.plugins.skip import SkipTest
+ 
+ class TestOsmApiFunctional(unittest.TestCase):
+     @httpretty.activate
+     def test_deleted_element_raises_exception(self):
++        if 'OFFLINE_TESTS' in os.environ:
++            raise SkipTest
++
+         httpretty.register_uri(
+             httpretty.GET,
+             "https://www.openstreetmap.org/api/0.6/relation/2911456/full",
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..99c4ae9
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+offline-tests.patch
diff --git a/debian/rules b/debian/rules
index 8cc69fd..1e7645f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,7 +8,7 @@ export PYBUILD_NAME=osmapi
 override_dh_auto_test:
 	# run tests
 	PYBUILD_SYSTEM=custom \
-	PYBUILD_TEST_ARGS="nosetests --verbose" dh_auto_test
+	PYBUILD_TEST_ARGS="nosetests --verbose" OFFLINE_TESTS=1 dh_auto_test
 
 override_dh_installchangelogs:
 	dh_installchangelogs CHANGELOG.md

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



More information about the Pkg-grass-devel mailing list