From 568d52ccf33e6d7683f36f5fe2e3c32b47892216 Mon Sep 17 00:00:00 2001 From: kali Date: Tue, 28 Aug 2012 05:30:38 +0900 Subject: eipchecker.fetch definition and tests deprecated base:test_config.test_complete_file (dup functionality) --- src/leap/base/constants.py | 16 ++++++++++++++++ src/leap/base/tests/test_config.py | 37 +++++++++++++++++++------------------ 2 files changed, 35 insertions(+), 18 deletions(-) (limited to 'src/leap/base') diff --git a/src/leap/base/constants.py b/src/leap/base/constants.py index 55308a31..991a1dfe 100644 --- a/src/leap/base/constants.py +++ b/src/leap/base/constants.py @@ -6,3 +6,19 @@ # (we expect testers to add it to their /etc/hosts DEFAULT_TEST_PROVIDER = "testprovider.example.org" + +DEFINITION_EXPECTED_PATH = "provider-definition.json" + +DEFAULT_PROVIDER_DEFINITION = { + u'api_uri': u'https://api.testprovider.example.org/', + u'api_version': u'0.1.0', + u'ca_cert': u'8aab80ae4326fd30721689db813733783fe0bd7e', + u'ca_cert_uri': u'https://testprovider.example.org/cacert.pem', + u'description': {u'en': u'This is a test provider'}, + u'display_name': {u'en': u'Test Provider'}, + u'domain': u'testprovider.example.org', + u'enrollment_policy': u'open', + u'public_key': u'cb7dbd679f911e85bc2e51bd44afd7308ee19c21', + u'serial': 1, + u'services': [u'eip'], + u'version': u'0.1.0'} diff --git a/src/leap/base/tests/test_config.py b/src/leap/base/tests/test_config.py index 93de0782..54e4484c 100644 --- a/src/leap/base/tests/test_config.py +++ b/src/leap/base/tests/test_config.py @@ -59,26 +59,27 @@ class ProviderDefinitionTestCase(ProviderTest): with open(os.path.join(path, 'eip.json'), 'w') as fp: json.dump(eipconstants.EIP_SAMPLE_JSON, fp) - def test_complete_file(self): - with mock.patch.object(requests, "get") as mock_method: - mock_method.return_value.status_code = 200 - mock_method.return_value.json = { + # moved to eip.test_checks.test_fetch_definition + #def test_complete_file(self): + #with mock.patch.object(requests, "get") as mock_method: + #mock_method.return_value.status_code = 200 + #mock_method.return_value.json = { #XXX get from providers template - u'api_uri': u'https://api.testprovider.org/', - u'api_version': u'0.1.0', - u'ca_cert': u'8aab80ae4326fd30721689db813733783fe0bd7e', - u'ca_cert_uri': u'https://testprovider.org/cacert.pem', - u'description': {u'en': u'This is a test provider'}, - u'display_name': {u'en': u'Test Provider'}, - u'domain': u'testprovider.org', - u'enrollment_policy': u'open', - u'public_key': u'cb7dbd679f911e85bc2e51bd44afd7308ee19c21', - u'serial': 1, - u'services': [u'eip'], - u'version': u'0.1.0'} + #u'api_uri': u'https://api.testprovider.org/', + #u'api_version': u'0.1.0', + #u'ca_cert': u'8aab80ae4326fd30721689db813733783fe0bd7e', + #u'ca_cert_uri': u'https://testprovider.org/cacert.pem', + #u'description': {u'en': u'This is a test provider'}, + #u'display_name': {u'en': u'Test Provider'}, + #u'domain': u'testprovider.org', + #u'enrollment_policy': u'open', + #u'public_key': u'cb7dbd679f911e85bc2e51bd44afd7308ee19c21', + #u'serial': 1, + #u'services': [u'eip'], + #u'version': u'0.1.0'} # XXX why init to localhost? - cf = config.Configuration("http://localhost/") - self.assertIn('default', cf.providers) + #cf = config.Configuration("http://localhost/") + #self.assertIn('default', cf.providers) # # provider fetch tests block -- cgit v1.2.3