Skip to content
Snippets Groups Projects
Commit 7a6b60f1 authored by anarcat's avatar anarcat
Browse files

move network test from ui to separate file

parent 72a5e662
No related branches found
No related tags found
No related merge requests found
...@@ -24,12 +24,14 @@ be ran without internet access. ...@@ -24,12 +24,14 @@ be ran without internet access.
import unittest import unittest
import sys, os import os
import signal import sys
sys.path.insert(0, os.path.dirname(__file__) + '/..') sys.path.insert(0, os.path.dirname(__file__) + '/../..')
from monkeysign.gpg import TempKeyring from monkeysign.gpg import TempKeyring
from test_lib import TestTimeLimit, AlarmException, find_test_file from test_lib import TestTimeLimit, AlarmException, find_test_file
import test_ui
class TestGpgNetwork(TestTimeLimit): class TestGpgNetwork(TestTimeLimit):
"""Separate test cases for functions that hit the network """Separate test cases for functions that hit the network
...@@ -63,5 +65,14 @@ the network forever""" ...@@ -63,5 +65,14 @@ the network forever"""
TestTimeLimit.tearDown(self) TestTimeLimit.tearDown(self)
del self.gpg del self.gpg
class KeyserverTests(test_ui.BaseTestCase):
args = ['--keyserver', 'pool.sks-keyservers.net']
pattern = '7B75921E'
def test_find_key(self):
"""this should find the key on the keyservers"""
self.ui.find_key()
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
...@@ -451,14 +451,6 @@ Content-Transfer-Encoding: 7bit ...@@ -451,14 +451,6 @@ Content-Transfer-Encoding: 7bit
match = re.compile("""From: (([^ ]* )|("[^"]*" ))?<[^> ]*>$""", re.DOTALL | re.MULTILINE) match = re.compile("""From: (([^ ]* )|("[^"]*" ))?<[^> ]*>$""", re.DOTALL | re.MULTILINE)
self.assertRegexpMatches(self.email.as_string(), match) self.assertRegexpMatches(self.email.as_string(), match)
class KeyserverTests(BaseTestCase):
args = [ '--keyserver', 'pool.sks-keyservers.net' ]
pattern = '7B75921E'
def test_find_key(self):
"""this should find the key on the keyservers"""
self.ui.find_key()
class FakeKeyringTests(BaseTestCase): class FakeKeyringTests(BaseTestCase):
args = [] args = []
pattern = '96F47C6A' pattern = '96F47C6A'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment