From 7ffdbb79529d1d9d51c0490c6a42f200b47d5f72 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Thu, 9 Nov 2017 17:47:53 +0100 Subject: [PATCH] [travis] Disable non-local file download tests (cherry picked from commit 8d8f38d4c40a64082e396017cbca3399cfafb3ca) --- tests/src/python/test_qgsfiledownloader.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/src/python/test_qgsfiledownloader.py b/tests/src/python/test_qgsfiledownloader.py index ea3ee43a927d..f371cba586fa 100644 --- a/tests/src/python/test_qgsfiledownloader.py +++ b/tests/src/python/test_qgsfiledownloader.py @@ -57,6 +57,7 @@ def _make_download(self, url, destination, cancel=False): loop.exec_() + @unittest.skipIf(os.environ.get('TRAVIS', '') == 'true', 'Test with http://www.qgis.org unstable. Needs local server.') def test_validDownload(self): """Tests a valid download""" destination = tempfile.mktemp() @@ -81,6 +82,7 @@ def test_inValidDownload(self): self.assertEqual(self.error_args[1], [u'Download failed: Host www.doesnotexistofthatimsure.qgis not found']) self.assertFalse(os.path.isfile(destination)) + @unittest.skipIf(os.environ.get('TRAVIS', '') == 'true', 'Test with http://www.github.com unstable. Needs local server.') def test_dowloadCanceled(self): """Tests user canceled download""" destination = tempfile.mktemp() @@ -101,6 +103,7 @@ def test_InvalidUrl(self): self.assertFalse(os.path.isfile(destination)) self.assertEqual(self.error_args[1], [u"Download failed: Protocol \"xyz\" is unknown"]) + @unittest.skipIf(os.environ.get('TRAVIS', '') == 'true', 'Test with http://www.github.com unstable. Needs local server.') def test_InvalidFile(self): self._make_download('https://github.com/qgis/QGIS/archive/master.zip', "") self.assertTrue(self.exited_was_called) @@ -132,6 +135,7 @@ def ssl_compare(self, name, url, error): result = ';'.join(result) self.assertEqual(result, error, msg + "expected:\n%s\nactual:\n%s\n" % (error, result)) + @unittest.skipIf(os.environ.get('TRAVIS', '') == 'true', 'Test with badssl.com unstable. Needs local server.') def test_sslExpired(self): self.ssl_compare("expired", "https://expired.badssl.com/", "SSL Errors: ;The certificate has expired") self.ssl_compare("self-signed", "https://self-signed.badssl.com/", "SSL Errors: ;The certificate has expired;The certificate is self-signed, and untrusted")