示例#1
0
 def test_configure_pki_backend_noop(self, is_backend_mounted):
     client_mock = mock.MagicMock()
     is_backend_mounted.return_value = True
     vault_pki.configure_pki_backend(
         client_mock,
         'my_backend',
         ttl=42)
     self.assertFalse(client_mock.enable_secret_backend.called)
 def test_configure_pki_backend_default_ttl(self, is_backend_mounted):
     client_mock = mock.MagicMock()
     is_backend_mounted.return_value = False
     vault_pki.configure_pki_backend(client_mock, 'my_backend')
     client_mock.enable_secret_backend.assert_called_once_with(
         backend_type='pki',
         config={'max_lease_ttl': '87600h'},
         description='Charm created PKI backend',
         mount_point='my_backend')