Update hacking version
Change-Id: I0f018fe963256658682676fcd86520ceae590c75
This commit is contained in:
parent
954e9f5bfc
commit
975d6641f4
@ -223,7 +223,7 @@ latex_documents = [
|
||||
|
||||
linkcheck_anchors_ignore = [
|
||||
# skip gerrit anchors
|
||||
'\/q\/.*',
|
||||
'q\,.*',
|
||||
'\/c\/.*'
|
||||
'\\/q\\/.*',
|
||||
'q\\,.*',
|
||||
'\\/c\\/.*'
|
||||
]
|
||||
|
@ -162,13 +162,13 @@ def validate_values(data, valid_values=None, valid_values_display=None):
|
||||
LOG.debug(msg)
|
||||
return msg
|
||||
except TypeError:
|
||||
# This is a programming error
|
||||
msg = (_("'data' of type '%(typedata)s' and 'valid_values' "
|
||||
"of type '%(typevalues)s' are not "
|
||||
"compatible for comparison") %
|
||||
{'typedata': type(data),
|
||||
'typevalues': type(valid_values)})
|
||||
raise TypeError(msg)
|
||||
# This is a programming error
|
||||
msg = (_("'data' of type '%(typedata)s' and 'valid_values' "
|
||||
"of type '%(typevalues)s' are not "
|
||||
"compatible for comparison") %
|
||||
{'typedata': type(data),
|
||||
'typevalues': type(valid_values)})
|
||||
raise TypeError(msg)
|
||||
else:
|
||||
# This is a programming error
|
||||
msg = (_("'valid_values' does not support membership operations"))
|
||||
|
@ -323,12 +323,12 @@ class IpAddressInUse(InUse):
|
||||
|
||||
|
||||
class VlanIdInUse(InUse):
|
||||
"""An exception indicating VLAN creation failed because it's already in use.
|
||||
"""A network operational error indicating a VLAN ID is already in use.
|
||||
|
||||
A specialization of the InUse exception indicating network creation failed
|
||||
because a specified VLAN is already in use on the physical network.
|
||||
|
||||
:param vlan_id: The LVAN ID.
|
||||
:param vlan_id: The VLAN ID.
|
||||
:param physical_network: The physical network.
|
||||
"""
|
||||
message = _("Unable to create the network. "
|
||||
|
@ -52,6 +52,7 @@ def assert_validator(tester, attribute, attribute_dict, keyword, value):
|
||||
tester.assertIn(list(value)[0], validators.validators,
|
||||
'%s is not a known validator for %s.' % (value, attribute))
|
||||
|
||||
|
||||
ASSERT_FUNCTIONS = {
|
||||
'allow_post': assert_bool,
|
||||
'allow_put': assert_bool,
|
||||
|
@ -44,11 +44,15 @@ class GloriousObjectWithCallback(ObjectWithCallback):
|
||||
|
||||
def callback_1(*args, **kwargs):
|
||||
callback_1.counter += 1
|
||||
|
||||
|
||||
callback_id_1 = manager._get_id(callback_1)
|
||||
|
||||
|
||||
def callback_2(*args, **kwargs):
|
||||
callback_2.counter += 1
|
||||
|
||||
|
||||
callback_id_2 = manager._get_id(callback_2)
|
||||
|
||||
|
||||
|
@ -68,43 +68,43 @@ class TestBaseWorker(base.BaseTestCase):
|
||||
with mock.patch('setproctitle.setproctitle') as spt:
|
||||
_ProcWorker().start()
|
||||
six.assertRegex(self, spt.call_args[0][0],
|
||||
'^neutron-server: _ProcWorker \(.*python.*\)$')
|
||||
'^neutron-server: _ProcWorker \\(.*python.*\\)$')
|
||||
|
||||
def test_proctitle_custom_desc(self):
|
||||
with mock.patch('setproctitle.setproctitle') as spt:
|
||||
_ProcWorker().start(desc="fancy title")
|
||||
six.assertRegex(self, spt.call_args[0][0],
|
||||
'^neutron-server: fancy title \(.*python.*\)$')
|
||||
'^neutron-server: fancy title \\(.*python.*\\)$')
|
||||
|
||||
def test_proctitle_custom_name(self):
|
||||
with mock.patch('setproctitle.setproctitle') as spt:
|
||||
_ProcWorker().start(name="tardis")
|
||||
six.assertRegex(self, spt.call_args[0][0],
|
||||
'^tardis: _ProcWorker \(.*python.*\)$')
|
||||
'^tardis: _ProcWorker \\(.*python.*\\)$')
|
||||
|
||||
def test_proctitle_empty(self):
|
||||
with mock.patch('setproctitle.setproctitle') as spt:
|
||||
_ProcWorker().start(desc="")
|
||||
six.assertRegex(self, spt.call_args[0][0],
|
||||
'^neutron-server: _ProcWorker \(.*python.*\)$')
|
||||
'^neutron-server: _ProcWorker \\(.*python.*\\)$')
|
||||
|
||||
def test_proctitle_nonstring(self):
|
||||
with mock.patch('setproctitle.setproctitle') as spt:
|
||||
_ProcWorker().start(desc=2)
|
||||
six.assertRegex(self, spt.call_args[0][0],
|
||||
'^neutron-server: 2 \(.*python.*\)$')
|
||||
'^neutron-server: 2 \\(.*python.*\\)$')
|
||||
|
||||
def test_proctitle_both_empty(self):
|
||||
with mock.patch('setproctitle.setproctitle') as spt:
|
||||
_ProcWorker().start(name="", desc="")
|
||||
six.assertRegex(self, spt.call_args[0][0],
|
||||
'^: _ProcWorker \(.*python.*\)$')
|
||||
'^: _ProcWorker \\(.*python.*\\)$')
|
||||
|
||||
def test_proctitle_name_none(self):
|
||||
with mock.patch('setproctitle.setproctitle') as spt:
|
||||
_ProcWorker().start(name=None)
|
||||
six.assertRegex(self, spt.call_args[0][0],
|
||||
'^None: _ProcWorker \(.*python.*\)$')
|
||||
'^None: _ProcWorker \\(.*python.*\\)$')
|
||||
|
||||
# Forked, but proctitle disabled
|
||||
|
||||
@ -124,7 +124,7 @@ class TestBaseWorker(base.BaseTestCase):
|
||||
with mock.patch('setproctitle.setproctitle') as spt:
|
||||
_ProcWorker(set_proctitle='on').start(name="foo", desc="bar")
|
||||
six.assertRegex(self, spt.call_args[0][0],
|
||||
'^foo: bar \(.*python.*\)$')
|
||||
'^foo: bar \\(.*python.*\\)$')
|
||||
|
||||
def test_setproctitle_off(self):
|
||||
with mock.patch('setproctitle.setproctitle') as spt:
|
||||
|
@ -2,7 +2,7 @@
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# process, which may cause wedges in the gate later.
|
||||
|
||||
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
|
||||
hacking>=1.1.0,<1.2.0 # Apache-2.0
|
||||
|
||||
bandit>=1.1.0 # Apache-2.0
|
||||
coverage!=4.4,>=4.0 # Apache-2.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user