Merge "Reduce extraneous test output"
This commit is contained in:
commit
c4e19b8f3c
@ -132,10 +132,9 @@ def stub_out_registry_and_store_server(stubs, base_dir, **kwargs):
|
|||||||
|
|
||||||
def endheaders(self):
|
def endheaders(self):
|
||||||
hl = [i.lower() for i in self.req.headers.keys()]
|
hl = [i.lower() for i in self.req.headers.keys()]
|
||||||
assert(not ('content-length' in hl and
|
assert not ('content-length' in hl and
|
||||||
'transfer-encoding' in hl),
|
'transfer-encoding' in hl), \
|
||||||
'Content-Length and Transfer-Encoding '
|
'Content-Length and Transfer-Encoding are mutually exclusive'
|
||||||
'are mutually exclusive')
|
|
||||||
|
|
||||||
def send(self, data):
|
def send(self, data):
|
||||||
# send() is called during chunked-transfer encoding, and
|
# send() is called during chunked-transfer encoding, and
|
||||||
|
@ -32,6 +32,7 @@ class TestManageBase(testtools.TestCase):
|
|||||||
def clear_conf():
|
def clear_conf():
|
||||||
manage.CONF.reset()
|
manage.CONF.reset()
|
||||||
manage.CONF.unregister_opt(manage.command_opt)
|
manage.CONF.unregister_opt(manage.command_opt)
|
||||||
|
clear_conf()
|
||||||
self.addCleanup(clear_conf)
|
self.addCleanup(clear_conf)
|
||||||
|
|
||||||
self.patcher = mock.patch('glance.db.sqlalchemy.api.get_engine')
|
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):
|
def _main_test_helper(self, argv, func_name=None, *exp_args, **exp_kwargs):
|
||||||
self.useFixture(fixtures.MonkeyPatch('sys.argv', argv))
|
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()
|
manage.main()
|
||||||
func_name.assert_called_once_with(*exp_args, **exp_kwargs)
|
func_name.assert_called_once_with(*exp_args, **exp_kwargs)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user