test_client_redirects.py (glance-20.0.0) | : | test_client_redirects.py (glance-20.0.1) | ||
---|---|---|---|---|
skipping to change at line 17 | skipping to change at line 17 | |||
# | # | |||
# 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 cases testing glance client redirect-following.""" | """Functional test cases testing glance client redirect-following.""" | |||
import os | ||||
import eventlet.patcher | import eventlet.patcher | |||
from six.moves import http_client as http | from six.moves import http_client as http | |||
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 | |||
from glance.tests import utils | from glance.tests import utils | |||
skipping to change at line 86 | skipping to change at line 84 | |||
return "fail" | return "fail" | |||
return App | return App | |||
class TestClientRedirects(functional.FunctionalTest): | class TestClientRedirects(functional.FunctionalTest): | |||
def setUp(self): | def setUp(self): | |||
super(TestClientRedirects, self).setUp() | super(TestClientRedirects, self).setUp() | |||
self.port_one = utils.get_unused_port() | self.port_one = utils.get_unused_port() | |||
self.port_two = utils.get_unused_port() | self.port_two = 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_one = wsgi.Server() | server_one = wsgi.Server() | |||
server_two = wsgi.Server() | server_two = 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_one.start(RedirectTestApp("one")(), self.port_one) | server_one.start(RedirectTestApp("one")(), self.port_one) | |||
server_two.start(RedirectTestApp("two")(), self.port_two) | server_two.start(RedirectTestApp("two")(), self.port_two) | |||
self.client = client.BaseClient("127.0.0.1", self.port_one) | self.client = client.BaseClient("127.0.0.1", self.port_one) | |||
def test_get_without_redirect(self): | def test_get_without_redirect(self): | |||
""" | """ | |||
End of changes. 2 change blocks. | ||||
6 lines changed or deleted | 0 lines changed or added |