| # HG changeset patch |
| # User Vinay Sajip <vinay_sajip@yahoo.co.uk> |
| # Date 1528916733 -3600 |
| # Node ID f16d4e17cf349cf9ee561e117262a4041e4fe2ee |
| # Parent 60ece27e564ef381392dc19a544aa289fb598c7e |
| Conditionally skip tests that rely on flaky external servers/networks. |
| |
| diff --git a/gnupg.py b/gnupg.py |
| --- a/gnupg.py |
| +++ b/gnupg.py |
| @@ -1118,7 +1118,7 @@ |
| >>> gpg = GPG(gpgbinary=GPGBINARY, gnupghome="keys") |
| >>> os.chmod('keys', 0x1C0) |
| >>> result = gpg.recv_keys('pgp.mit.edu', '92905378') |
| - >>> assert result |
| + >>> if 'NO_EXTERNAL_TESTS' not in os.environ: assert result |
| |
| """ |
| result = self.result_map['import'](self) |
| @@ -1321,7 +1321,7 @@ |
| >>> gpg = GPG(gpgbinary=GPGBINARY, gnupghome='keys') |
| >>> os.chmod('keys', 0x1C0) |
| >>> result = gpg.search_keys('<vinay_sajip@hotmail.com>') |
| - >>> assert result, 'Failed using default keyserver' |
| + >>> if 'NO_EXTERNAL_TESTS' not in os.environ: assert result, 'Failed using default keyserver' |
| >>> #keyserver = 'keyserver.ubuntu.com' |
| >>> #result = gpg.search_keys('<vinay_sajip@hotmail.com>', keyserver) |
| >>> #assert result, 'Failed using keyserver.ubuntu.com' |
| diff --git a/test_gnupg.py b/test_gnupg.py |
| --- a/test_gnupg.py |
| +++ b/test_gnupg.py |
| @@ -836,12 +836,13 @@ |
| #@skipIf(os.name == 'nt', 'Test not suitable for Windows') |
| def test_search_keys(self): |
| "Test that searching for keys works" |
| - r = self.gpg.search_keys('<vinay_sajip@hotmail.com>') |
| - self.assertTrue(r) |
| - self.assertTrue('Vinay Sajip <vinay_sajip@hotmail.com>' in r[0]['uids']) |
| - r = self.gpg.search_keys('92905378') |
| - self.assertTrue(r) |
| - self.assertTrue('Vinay Sajip <vinay_sajip@hotmail.com>' in r[0]['uids']) |
| + if 'NO_EXTERNAL_TESTS' not in os.environ: |
| + r = self.gpg.search_keys('<vinay_sajip@hotmail.com>') |
| + self.assertTrue(r) |
| + self.assertTrue('Vinay Sajip <vinay_sajip@hotmail.com>' in r[0]['uids']) |
| + r = self.gpg.search_keys('92905378') |
| + self.assertTrue(r) |
| + self.assertTrue('Vinay Sajip <vinay_sajip@hotmail.com>' in r[0]['uids']) |
| |
| def test_quote_with_shell(self): |
| "Test shell quoting with a real shell" |