From c3dd521b2608a62e09869a945d3125de4dcb99d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= <anarcat@debian.org>
Date: Tue, 4 Oct 2016 01:30:17 -0400
Subject: [PATCH] disable network tests in build

---
 debian/rules                     | 1 +
 monkeysign/tests/test_network.py | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/debian/rules b/debian/rules
index a02250f..7e114ad 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,6 +6,7 @@
 
 # This has to be exported to make some magic below work.
 export DH_OPTIONS
+export UNITTEST_NO_NETWORK=1
 
 %:
 	dh $@  --with=python2,sphinxdoc --buildsystem=pybuild
diff --git a/monkeysign/tests/test_network.py b/monkeysign/tests/test_network.py
index f355245..035fb81 100755
--- a/monkeysign/tests/test_network.py
+++ b/monkeysign/tests/test_network.py
@@ -33,6 +33,7 @@ from test_lib import TestTimeLimit, AlarmException, find_test_file
 import test_ui
 
 
+@unittest.skipIf('UNITTEST_NO_NETWORK' in os.environ, 'network tests disabled')
 class TestGpgNetwork(TestTimeLimit):
     """Separate test cases for functions that hit the network
 
@@ -66,6 +67,7 @@ the network forever"""
         del self.gpg
 
 
+@unittest.skipIf('UNITTEST_NO_NETWORK' in os.environ, 'network tests disabled')
 class KeyserverTests(test_ui.BaseTestCase):
     args = ['--keyserver', 'pool.sks-keyservers.net']
     pattern = '7B75921E'
-- 
GitLab