1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
Description: Disable tests that require network.
Author: Bas Couwenberg <sebastic@debian.org>
Forwarded: not-needed
--- a/tests/test_ows.py
+++ b/tests/test_ows.py
@@ -92,6 +92,7 @@ def create_sum_one():
class ExecuteTests(unittest.TestCase):
+ @unittest.skipIf('OFFLINE_TESTS' in os.environ, "offline tests only")
def test_wfs(self):
if not service_ok('https://demo.mapserver.org'):
self.skipTest("mapserver is unreachable")
@@ -118,6 +119,7 @@ class ExecuteTests(unittest.TestCase):
# . the inclusion of output
# . the type of output
+ @unittest.skipIf('OFFLINE_TESTS' in os.environ, "offline tests only")
def test_wcs(self):
if not config.CONFIG.get('grass', 'gisbase'):
self.skipTest('GRASS lib not found')
--- a/tests/validator/test_complexvalidators.py
+++ b/tests/validator/test_complexvalidators.py
@@ -83,7 +83,8 @@ class ValidateTest(unittest.TestCase):
self.assertTrue(validategml(gml_input, MODE.NONE), 'NONE validation')
self.assertTrue(validategml(gml_input, MODE.SIMPLE), 'SIMPLE validation')
self.assertTrue(validategml(gml_input, MODE.STRICT), 'STRICT validation')
- self.assertTrue(validategml(gml_input, MODE.VERYSTRICT), 'VERYSTRICT validation')
+ if os.environ.get('OFFLINE_TESTS') == None:
+ self.assertTrue(validategml(gml_input, MODE.VERYSTRICT), 'VERYSTRICT validation')
gml_input.stream.close()
def test_json_validator(self):
@@ -140,6 +141,8 @@ class ValidateTest(unittest.TestCase):
else:
self.assertFalse(validatenetcdf(netcdf_input, MODE.STRICT), 'STRICT validation')
+ @unittest.skipIf('OFFLINE_TESTS' in os.environ, "offline tests only")
+ @pytest.mark.skipif('OFFLINE_TESTS' in os.environ, reason="offline tests only")
@pytest.mark.xfail(reason="test.opendap.org is offline")
def test_dods_validator(self):
opendap_input = ComplexInput('dods', 'opendap test', [FORMATS.DODS,])
--- a/tests/test_execute.py
+++ b/tests/test_execute.py
@@ -235,6 +235,8 @@ def get_output(doc):
class ExecuteTest(unittest.TestCase):
"""Test for Exeucte request KVP request"""
+ @unittest.skipIf('OFFLINE_TESTS' in os.environ, "offline tests only")
+ @pytest.mark.skipif('OFFLINE_TESTS' in os.environ, reason="offline tests only")
@pytest.mark.xfail(reason="test.opendap.org is offline")
def test_dods(self):
if not WITH_NC4:
--- a/tests/test_inout.py
+++ b/tests/test_inout.py
@@ -130,6 +130,7 @@ class IOHandlerTest(unittest.TestCase):
with self.assertRaises(TypeError):
self.iohandler[0].data = '5'
+ @unittest.skipIf('OFFLINE_TESTS' in os.environ, "offline tests only")
def test_url(self):
if not service_ok('https://demo.mapserver.org'):
self.skipTest("mapserver is unreachable")
@@ -548,6 +549,7 @@ class ComplexOutputTest(unittest.TestCas
b = self.complex_out.base64
self.assertEqual(base64.b64decode(b).decode(), self.data)
+ @unittest.skipIf('OFFLINE_TESTS' in os.environ, "offline tests only")
def test_url_handler(self):
wfsResource = 'http://demo.mapserver.org/cgi-bin/wfs?' \
'service=WFS&version=1.1.0&' \
@@ -790,6 +792,7 @@ class BBoxOutputTest(unittest.TestCase):
)
+@unittest.skipIf('OFFLINE_TESTS' in os.environ, "offline tests only")
class TestMetaLink(unittest.TestCase):
tmp_dir = tempfile.mkdtemp()
|