Merge "Reduce extraneous test output"

This commit is contained in:
Jenkins 2014-10-15 21:43:28 +00:00 committed by Gerrit Code Review
commit c4e19b8f3c
2 changed files with 10 additions and 4 deletions

View File

@ -132,10 +132,9 @@ def stub_out_registry_and_store_server(stubs, base_dir, **kwargs):
def endheaders(self):
hl = [i.lower() for i in self.req.headers.keys()]
assert(not ('content-length' in hl and
'transfer-encoding' in hl),
'Content-Length and Transfer-Encoding '
'are mutually exclusive')
assert not ('content-length' in hl and
'transfer-encoding' in hl), \
'Content-Length and Transfer-Encoding are mutually exclusive'
def send(self, data):
# send() is called during chunked-transfer encoding, and

View File

@ -32,6 +32,7 @@ class TestManageBase(testtools.TestCase):
def clear_conf():
manage.CONF.reset()
manage.CONF.unregister_opt(manage.command_opt)
clear_conf()
self.addCleanup(clear_conf)
self.patcher = mock.patch('glance.db.sqlalchemy.api.get_engine')
@ -40,6 +41,12 @@ class TestManageBase(testtools.TestCase):
def _main_test_helper(self, argv, func_name=None, *exp_args, **exp_kwargs):
self.useFixture(fixtures.MonkeyPatch('sys.argv', argv))
def setup(product_name, version='unknown'):
pass
self.useFixture(fixtures.MonkeyPatch(
'glance.openstack.common.log.setup', setup))
manage.main()
func_name.assert_called_once_with(*exp_args, **exp_kwargs)