diff --git a/test_auth_token_middleware.py b/test_auth_token_middleware.py index 588c91f..4e2c2a3 100644 --- a/test_auth_token_middleware.py +++ b/test_auth_token_middleware.py @@ -31,6 +31,7 @@ import mock import webob from keystoneclient.common import cms +from keystoneclient import exceptions from keystoneclient.middleware import auth_token from keystoneclient.openstack.common import jsonutils from keystoneclient.openstack.common import memorycache @@ -876,7 +877,7 @@ class CertDownloadMiddlewareTest(BaseAuthTokenMiddlewareTest): httpretty.register_uri(httpretty.GET, "%s/v2.0/certificates/signing" % BASE_URI, status=404) - self.assertRaises(cms.subprocess.CalledProcessError, + self.assertRaises(exceptions.CertificateConfigError, self.middleware.verify_signed_token, client_fixtures.SIGNED_TOKEN_SCOPED) diff --git a/test_cms.py b/test_cms.py new file mode 100644 index 0000000..8f9cb73 --- /dev/null +++ b/test_cms.py @@ -0,0 +1,26 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from keystoneclient.common import cms +from keystoneclient import exceptions +from keystoneclient.tests import utils + + +class CMSTest(utils.TestCase): + def test_cms_verify(self): + self.assertRaises(exceptions.CertificateConfigError, + cms.cms_verify, + 'data', + 'no_exist_cert_file', + 'no_exist_ca_file')