summaryrefslogtreecommitdiff
path: root/src/leap/config/tests/test_providerconfig.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-06-28 13:18:15 -0300
committerTomás Touceda <chiiph@leap.se>2013-06-28 13:18:15 -0300
commit4785877270da1702aa3a4a170a62baa494eb35fa (patch)
tree3109f1edc3a3648b37f9ccd93f9eb9e3db16e6a8 /src/leap/config/tests/test_providerconfig.py
parent90c4d00b63edb379e5b0101ad870b528328247b1 (diff)
parent32b6afae6eb66cd75608b26aecd86bbfc587736e (diff)
Merge remote-tracking branch 'ivan/bug/3032_supported-services-fix' into develop
Diffstat (limited to 'src/leap/config/tests/test_providerconfig.py')
-rw-r--r--src/leap/config/tests/test_providerconfig.py29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/leap/config/tests/test_providerconfig.py b/src/leap/config/tests/test_providerconfig.py
index 57688fb0..4e86a5f7 100644
--- a/src/leap/config/tests/test_providerconfig.py
+++ b/src/leap/config/tests/test_providerconfig.py
@@ -29,6 +29,7 @@ import copy
from leap.common.testing.basetest import BaseLeapTest
from leap.config.providerconfig import ProviderConfig
+from leap.services import get_supported
from mock import Mock
@@ -235,8 +236,7 @@ class ProviderConfigTest(BaseLeapTest):
config['services'] = ['mx', 'other_service']
json_string = json.dumps(config)
pc.load(data=json_string)
- # TODO: we do not support mx yet
- self.assertFalse(pc.provides_mx())
+ self.assertTrue(pc.provides_mx())
# It does not provides
config['services'] = ['test_service', 'other_service']
@@ -244,14 +244,35 @@ class ProviderConfigTest(BaseLeapTest):
pc.load(data=json_string)
self.assertFalse(pc.provides_mx())
+ def test_supports_unknown_service(self):
+ pc = self._provider_config
+ config = copy.deepcopy(sample_config)
+
+ config['services'] = ['unknown']
+ json_string = json.dumps(config)
+ pc.load(data=json_string)
+ self.assertFalse('unknown' in get_supported(pc.get_services()))
+
+ def test_provides_unknown_service(self):
+ pc = self._provider_config
+ config = copy.deepcopy(sample_config)
+
+ config['services'] = ['unknown']
+ json_string = json.dumps(config)
+ pc.load(data=json_string)
+ self.assertTrue('unknown' in pc.get_services())
+
def test_get_services_string(self):
pc = self._provider_config
config = copy.deepcopy(sample_config)
- config['services'] = ['test01', 'test02']
+ config['services'] = [
+ 'openvpn', 'asdf', 'openvpn', 'not_supported_service']
json_string = json.dumps(config)
pc.load(data=json_string)
- self.assertEqual(pc.get_services_string(), "test01, test02")
+ self.assertEqual(pc.get_services_string(),
+ "Encrypted Internet, asdf, Encrypted Internet,"
+ " not_supported_service")
if __name__ == "__main__":