diff options
Diffstat (limited to 'src/leap/base/tests')
-rw-r--r-- | src/leap/base/tests/test_auth.py | 13 | ||||
-rw-r--r-- | src/leap/base/tests/test_checks.py | 8 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/leap/base/tests/test_auth.py b/src/leap/base/tests/test_auth.py index a6f2ceb9..17b84b52 100644 --- a/src/leap/base/tests/test_auth.py +++ b/src/leap/base/tests/test_auth.py @@ -1,14 +1,15 @@ from BaseHTTPServer import BaseHTTPRequestHandler +import urlparse try: import unittest2 as unittest except ImportError: import unittest import requests -from mock import Mock +#from mock import Mock from leap.base import auth -from leap.base import exceptions +#from leap.base import exceptions from leap.eip.tests.test_checks import NoLogRequestHandler from leap.testing.basetest import BaseLeapTest from leap.testing.https_server import BaseHTTPSServerTestCase @@ -20,8 +21,7 @@ class LeapSRPRegisterTests(BaseHTTPSServerTestCase, BaseLeapTest): class request_handler(NoLogRequestHandler, BaseHTTPRequestHandler): responses = { - '/': ['OK', ''], - } + '/': ['OK', '']} def do_GET(self): path = urlparse.urlparse(self.path) @@ -53,5 +53,6 @@ class LeapSRPRegisterTests(BaseHTTPSServerTestCase, BaseLeapTest): srp_auth = auth.LeapSRPRegister(provider=SERVER, verify=False) self.assertIsInstance(srp_auth.session, requests.sessions.Session) - self.assertEqual(srp_auth.get_registration_uri(), - "https://localhost:8443/1/users.json") + self.assertEqual( + srp_auth.get_registration_uri(), + "https://localhost:8443/1/users.json") diff --git a/src/leap/base/tests/test_checks.py b/src/leap/base/tests/test_checks.py index 272e7053..7a694f89 100644 --- a/src/leap/base/tests/test_checks.py +++ b/src/leap/base/tests/test_checks.py @@ -119,16 +119,16 @@ class LeapNetworkCheckTest(BaseLeapTest): checker.check_internet_connection() with patch.object(requests, "get") as mocked_get: - mocked_get.side_effect = \ - requests.ConnectionError("[Errno 113] No route to host") + mocked_get.side_effect = requests.ConnectionError( + "[Errno 113] No route to host") with self.assertRaises(exceptions.NoInternetConnection): with patch.object(checker, "ping_gateway") as mock_ping: mock_ping.return_value = True checker.check_internet_connection() with patch.object(requests, "get") as mocked_get: - mocked_get.side_effect = \ - requests.ConnectionError("[Errno 113] No route to host") + mocked_get.side_effect = requests.ConnectionError( + "[Errno 113] No route to host") with self.assertRaises(exceptions.NoInternetConnection): with patch.object(checker, "ping_gateway") as mock_ping: mock_ping.side_effect = exceptions.NoConnectionToGateway |