Esempio n. 1
0
 def test_get_missing_ca(self):
     """Retrieve a missing ca; return an empty result object."""
     ca_name = 'missing-ca'
     ca = SpokeCA(ca_name)
     result = ca.get()
     expected_result = {'count': 0, 'type': 'CA', 'data': [], 'exit_code': 3,
                        'msg': 'No CA(s) found'}
     self.assertEqual(result, expected_result)
Esempio n. 2
0
 def test_get_missing_ca(self):
     """Retrieve a missing ca; return an empty result object."""
     ca_name = 'missing-ca'
     ca = SpokeCA(ca_name)
     result = ca.get()
     expected_result = {
         'count': 0,
         'type': 'CA',
         'data': [],
         'exit_code': 3,
         'msg': 'No CA(s) found'
     }
     self.assertEqual(result, expected_result)
Esempio n. 3
0
 def test_get_ca(self):
     """Retrieve a ca; return result object."""
     ca = SpokeCA(self.ca_name)
     expected_result = {'count': 1, 'type': 'CA', 'exit_code': 0, 
                        'msg': 'Found CA:'}
     expected_result['data'] = [{'ca_cn': self.ca_cn,
                         'ca_key': self.ca_key_file,
                         'ca_def_duration': self.ca_def_duration,
                         'ca_cert_file': self.ca_cert_file,
                         'ca_cert_as_pem': ''}]
     result = ca.get()
     result['data'][0]['ca_cert_as_pem'] = ''
     self.assertEqual(result, expected_result)
Esempio n. 4
0
 def test_get_ca(self):
     """Retrieve a ca; return result object."""
     ca = SpokeCA(self.ca_name)
     expected_result = {
         'count': 1,
         'type': 'CA',
         'exit_code': 0,
         'msg': 'Found CA:'
     }
     expected_result['data'] = [{
         'ca_cn': self.ca_cn,
         'ca_key': self.ca_key_file,
         'ca_def_duration': self.ca_def_duration,
         'ca_cert_file': self.ca_cert_file,
         'ca_cert_as_pem': ''
     }]
     result = ca.get()
     result['data'][0]['ca_cert_as_pem'] = ''
     self.assertEqual(result, expected_result)