"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "glance/tests/functional/test_client_exceptions.py" between
glance-20.0.0.tar.gz and glance-20.0.1.tar.gz

About: OpenStack Glance (Core Service: Image Service) stores and retrieves virtual machine disk images. OpenStack Compute makes use of this during instance provisioning.
The "Ussuri" series (latest release).

test_client_exceptions.py  (glance-20.0.0):test_client_exceptions.py  (glance-20.0.1)
skipping to change at line 18 skipping to change at line 18
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
"""Functional test asserting strongly typed exceptions from glance client""" """Functional test asserting strongly typed exceptions from glance client"""
import os
import eventlet.patcher import eventlet.patcher
import httplib2 import httplib2
from six.moves import http_client from six.moves import http_client
import webob.dec import webob.dec
import webob.exc import webob.exc
from glance.common import client from glance.common import client
from glance.common import exception from glance.common import exception
from glance.common import wsgi from glance.common import wsgi
from glance.tests import functional from glance.tests import functional
skipping to change at line 72 skipping to change at line 70
request.response = webob.exc.HTTPServerError() request.response = webob.exc.HTTPServerError()
elif path == "/server-traceback": elif path == "/server-traceback":
raise exception.ServerError() raise exception.ServerError()
class TestClientExceptions(functional.FunctionalTest): class TestClientExceptions(functional.FunctionalTest):
def setUp(self): def setUp(self):
super(TestClientExceptions, self).setUp() super(TestClientExceptions, self).setUp()
self.port = utils.get_unused_port() self.port = utils.get_unused_port()
self.image_cache_dir = os.path.join(self.test_dir,
'cache')
self.config(image_cache_dir=self.image_cache_dir)
self.config(image_cache_driver='sqlite')
server = wsgi.Server() server = wsgi.Server()
self.config(bind_host='127.0.0.1') self.config(bind_host='127.0.0.1')
self.config(workers=0) self.config(workers=0)
server.start(ExceptionTestApp(), self.port) server.start(ExceptionTestApp(), self.port)
self.client = client.BaseClient("127.0.0.1", self.port) self.client = client.BaseClient("127.0.0.1", self.port)
def _do_test_exception(self, path, exc_type): def _do_test_exception(self, path, exc_type):
try: try:
self.client.do_request("GET", path) self.client.do_request("GET", path)
self.fail('expected %s' % exc_type) self.fail('expected %s' % exc_type)
 End of changes. 2 change blocks. 
6 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)