File: skip_network_needing_test.patch

package info (click to toggle)
python-gnupg 0.3.9-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 392 kB
  • ctags: 525
  • sloc: python: 4,933; makefile: 21; sh: 6
file content (55 lines) | stat: -rw-r--r-- 2,229 bytes parent folder | download
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
From 7a72a5cdc56afed312e44dd45ecc17b026469935 Mon Sep 17 00:00:00 2001
From: Elena Grandi <elena.valhalla@gmail.com>
Date: Thu, 8 Oct 2015 12:11:21 -0700
Subject: Skip tests that require internet access

Forwarded: not-needed
Patch-Name: skip_network_needing_test.patch
---
 gnupg.py      | 12 ++++++------
 test_gnupg.py |  1 +
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/gnupg.py b/gnupg.py
index 4515841..2a08d96 100644
--- a/gnupg.py
+++ b/gnupg.py
@@ -1066,8 +1066,8 @@ class GPG(object):
         >>> shutil.rmtree("keys")
         >>> gpg = GPG(gnupghome="keys")
         >>> os.chmod('keys', 0x1C0)
-        >>> result = gpg.recv_keys('keyserver.ubuntu.com', '92905378')
-        >>> assert result
+        >>> result = gpg.recv_keys('keyserver.ubuntu.com', '92905378')  # doctest: +SKIP
+        >>> assert result  # doctest: +SKIP
 
         """
         result = self.result_map['import'](self)
@@ -1215,11 +1215,11 @@ class GPG(object):
         >>> shutil.rmtree('keys')
         >>> gpg = GPG(gnupghome='keys')
         >>> os.chmod('keys', 0x1C0)
-        >>> result = gpg.search_keys('<vinay_sajip@hotmail.com>')
-        >>> assert result, 'Failed using default keyserver'
+        >>> result = gpg.search_keys('<vinay_sajip@hotmail.com>')  # doctest: +SKIP
+        >>> assert result, 'Failed using default keyserver'  # doctest: +SKIP
         >>> keyserver = 'keyserver.ubuntu.com'
-        >>> result = gpg.search_keys('<vinay_sajip@hotmail.com>', keyserver)
-        >>> assert result, 'Failed using keyserver.ubuntu.com'
+        >>> result = gpg.search_keys('<vinay_sajip@hotmail.com>', keyserver)  # doctest: +SKIP
+        >>> assert result, 'Failed using keyserver.ubuntu.com'  # doctest: +SKIP
 
         """
         query = query.strip()
diff --git a/test_gnupg.py b/test_gnupg.py
index 34c48bb..3559e62 100644
--- a/test_gnupg.py
+++ b/test_gnupg.py
@@ -694,6 +694,7 @@ class GPGTestCase(unittest.TestCase):
             shutil.rmtree(d)
         logger.debug("test_filename_with_spaces ends")
 
+    @unittest.skip('requires network')
     def test_search_keys(self):
         "Test that searching for keys works"
         r = self.gpg.search_keys('<vinay_sajip@hotmail.com>')