summaryrefslogtreecommitdiff
path: root/src/leap/base
diff options
context:
space:
mode:
Diffstat (limited to 'src/leap/base')
-rw-r--r--src/leap/base/network.py2
-rw-r--r--src/leap/base/tests/test_checks.py7
-rw-r--r--src/leap/base/tests/test_providers.py6
3 files changed, 12 insertions, 3 deletions
diff --git a/src/leap/base/network.py b/src/leap/base/network.py
index 3891b00a..3aba3f61 100644
--- a/src/leap/base/network.py
+++ b/src/leap/base/network.py
@@ -31,7 +31,7 @@ class NetworkCheckerThread(object):
# see in eip.config for function
# #718
self.checker = LeapNetworkChecker(
- provider_gw = get_eip_gateway())
+ provider_gw=get_eip_gateway())
def start(self):
self.process_handle = self._launch_recurrent_network_checks(
diff --git a/src/leap/base/tests/test_checks.py b/src/leap/base/tests/test_checks.py
index bec09ce6..8d573b1e 100644
--- a/src/leap/base/tests/test_checks.py
+++ b/src/leap/base/tests/test_checks.py
@@ -40,7 +40,14 @@ class LeapNetworkCheckTest(BaseLeapTest):
def test_checker_should_actually_call_all_tests(self):
checker = checks.LeapNetworkChecker()
+ mc = Mock()
+ checker.run_all(checker=mc)
+ self.assertTrue(mc.check_internet_connection.called, "not called")
+ self.assertTrue(mc.check_tunnel_default_interface.called, "not called")
+ self.assertTrue(mc.is_internet_up.called, "not called")
+ # ping gateway only called if we pass provider_gw
+ checker = checks.LeapNetworkChecker(provider_gw="0.0.0.0")
mc = Mock()
checker.run_all(checker=mc)
self.assertTrue(mc.check_internet_connection.called, "not called")
diff --git a/src/leap/base/tests/test_providers.py b/src/leap/base/tests/test_providers.py
index 8d3b8847..15c4ed58 100644
--- a/src/leap/base/tests/test_providers.py
+++ b/src/leap/base/tests/test_providers.py
@@ -30,7 +30,9 @@ EXPECTED_DEFAULT_CONFIG = {
class TestLeapProviderDefinition(BaseLeapTest):
def setUp(self):
- self.definition = providers.LeapProviderDefinition()
+ self.domain = "testprovider.example.org"
+ self.definition = providers.LeapProviderDefinition(
+ domain=self.domain)
self.definition.save()
self.definition.load()
self.config = self.definition.config
@@ -51,7 +53,7 @@ class TestLeapProviderDefinition(BaseLeapTest):
os.path.join(
self.home,
'.config', 'leap', 'providers',
- '%s' % BRANDING.get('provider_domain'),
+ '%s' % self.domain,
'provider.json'))
with self.assertRaises(AttributeError):
self.definition.slug = 23