Update hacking version

Use latest release 1.1.0 and compatible changes w.r.t pep8

Change-Id: Iaeebe7f3f76339f0c34c9e0f4db838ec192dbd83
This commit is contained in:
zhulingjie 2019-01-05 01:48:17 +08:00
parent e794e34bf4
commit bb7a0fb1cb
4 changed files with 31 additions and 30 deletions

View File

@ -235,8 +235,8 @@ class BgpTests(BgpEntityCreationMixin):
name='speaker1'),\
self.bgp_speaker(sp2['ip_version'], 4321,
name='speaker2'):
speakers = self.bgp_plugin.get_bgp_speakers(self.context)
self.assertEqual(2, len(speakers))
speakers = self.bgp_plugin.get_bgp_speakers(self.context)
self.assertEqual(2, len(speakers))
def test_bgp_speaker_update_local_as(self):
local_as_1 = 1234
@ -639,10 +639,9 @@ class BgpTests(BgpEntityCreationMixin):
local_as,
networks=[gw_net_id],
advertise_fip_host_routes=fip_routes) as speaker:
routes = self.bgp_plugin.get_advertised_routes(
self.context,
speaker['id'])
return routes['advertised_routes']
routes = self.bgp_plugin.get_advertised_routes(
self.context, speaker['id'])
return routes['advertised_routes']
def test__tenant_prefixes_by_router_no_gateway_port(self):
with self.network() as net1, self.network() as net2,\
@ -734,24 +733,23 @@ class BgpTests(BgpEntityCreationMixin):
network=int_net,
ip_version=6) as int_subnet,\
self.router() as router:
router_id = router['id']
int_subnet_id = int_subnet['subnet']['id']
ext_subnet_id = ext_subnet['subnet']['id']
self.l3plugin.add_router_interface(self.context,
router_id,
{'subnet_id':
int_subnet_id})
self.l3plugin.add_router_interface(self.context,
router_id,
{'subnet_id':
ext_subnet_id})
with self.bgp_speaker(6, 1234,
networks=[gw_net_id]) as speaker:
bgp_speaker_id = speaker['id']
cidrs = self.bgp_plugin.get_routes_by_bgp_speaker_id(
self.context,
bgp_speaker_id)
self.assertEqual(0, len(list(cidrs)))
router_id = router['id']
int_subnet_id = int_subnet['subnet']['id']
ext_subnet_id = ext_subnet['subnet']['id']
self.l3plugin.add_router_interface(self.context,
router_id,
{'subnet_id':
int_subnet_id})
self.l3plugin.add_router_interface(self.context,
router_id,
{'subnet_id':
ext_subnet_id})
with self.bgp_speaker(6, 1234,
networks=[gw_net_id]) as speaker:
bgp_speaker_id = speaker['id']
cidrs = self.bgp_plugin.get_routes_by_bgp_speaker_id(
self.context, bgp_speaker_id)
self.assertEqual(0, len(list(cidrs)))
def test__get_routes_by_router_with_fip(self):
gw_prefix = '172.16.10.0/24'

View File

@ -50,10 +50,10 @@ class TestValidateMethod(base.BaseTestCase):
bgp_driver_utils.validate_as_num('local_as', '64512')
def test_validate_as_num_with_invalid_max_range(self):
allowed_range = ('\[' +
allowed_range = ('\\[' +
str(bgp_consts.MIN_ASNUM) + '-' +
str(bgp_consts.MAX_4BYTE_ASNUM) +
'\]')
'\\]')
with self.assertRaisesRegex(
bgp_driver_exc.InvalidParamRange,
EXC_INV_PARAMRANGE % {'param': 'local_as',
@ -62,10 +62,10 @@ class TestValidateMethod(base.BaseTestCase):
bgp_consts.MAX_4BYTE_ASNUM + 1)
def test_validate_as_num_with_invalid_min_range(self):
allowed_range = ('\[' +
allowed_range = ('\\[' +
str(bgp_consts.MIN_ASNUM) + '-' +
str(bgp_consts.MAX_4BYTE_ASNUM) +
'\]')
'\\]')
with self.assertRaisesRegex(
bgp_driver_exc.InvalidParamRange,
EXC_INV_PARAMRANGE % {'param': 'local_as',

View File

@ -1,7 +1,7 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking<0.12,>=0.11.0 # Apache-2.0
hacking>=1.1.0,<1.2.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD

View File

@ -99,7 +99,10 @@ commands = python setup.py build_sphinx
# N537 Log messages should not be translated
# H106 Dont put vim configuration in source files
# H203 Use assertIs(Not)None to check for None
ignore = E125,E126,E128,E129,E265,H404,H405,N530,N537
# W504 line break after binary operator
# (W503 and W504 are incompatible and we need to choose one of them.
# Existing codes follows W503, so we disable W504.)
ignore = E125,E126,E128,E129,E265,H404,H405,N530,N537,W504
enable-extensions=H106,H203
show-source = true
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,.ropeproject,rally-scenarios