Fix flake8 H404 errors
Fix H404 error and start enforcing it. Trivialfix Change-Id: I0c062733660031faf43838798a697daf6674ef14
This commit is contained in:
parent
2184942995
commit
ae328b923a
@ -40,9 +40,10 @@ class AgentAvailabilityZoneTestCase(base.BaseAdminNetworkTest):
|
|||||||
@testtools.skipUnless(CONF.neutron_plugin_options.agent_availability_zone,
|
@testtools.skipUnless(CONF.neutron_plugin_options.agent_availability_zone,
|
||||||
"Need a single availability_zone assumption.")
|
"Need a single availability_zone assumption.")
|
||||||
def test_agents_availability_zone(self):
|
def test_agents_availability_zone(self):
|
||||||
"""
|
"""Test list agents availability_zone
|
||||||
Test list agents availability_zone, only L3 and DHCP agent support
|
|
||||||
availability_zone, default availability_zone is "nova".
|
Only L3 and DHCP agent support availability_zone, default
|
||||||
|
availability_zone is "nova".
|
||||||
"""
|
"""
|
||||||
body = self.admin_client.list_agents()
|
body = self.admin_client.list_agents()
|
||||||
agents = body['agents']
|
agents = body['agents']
|
||||||
|
@ -81,9 +81,7 @@ class AgentManagementTestJSON(base.BaseAdminNetworkTest):
|
|||||||
self.assertEqual(updated_description, description)
|
self.assertEqual(updated_description, description)
|
||||||
|
|
||||||
def _restore_agent(self, dyn_agent):
|
def _restore_agent(self, dyn_agent):
|
||||||
"""
|
"""Restore the agent description after update test."""
|
||||||
Restore the agent description after update test.
|
|
||||||
"""
|
|
||||||
description = dyn_agent['description']
|
description = dyn_agent['description']
|
||||||
origin_agent = {'description': description}
|
origin_agent = {'description': description}
|
||||||
self.admin_client.update_agent(agent_id=dyn_agent['id'],
|
self.admin_client.update_agent(agent_id=dyn_agent['id'],
|
||||||
|
@ -44,7 +44,8 @@ class RoutersTestDVR(RoutersTestDVRBase):
|
|||||||
|
|
||||||
@decorators.idempotent_id('08a2a0a8-f1e4-4b34-8e30-e522e836c44e')
|
@decorators.idempotent_id('08a2a0a8-f1e4-4b34-8e30-e522e836c44e')
|
||||||
def test_distributed_router_creation(self):
|
def test_distributed_router_creation(self):
|
||||||
"""
|
"""Test distributed router creation
|
||||||
|
|
||||||
Test uses administrative credentials to creates a
|
Test uses administrative credentials to creates a
|
||||||
DVR (Distributed Virtual Routing) router using the
|
DVR (Distributed Virtual Routing) router using the
|
||||||
distributed=True.
|
distributed=True.
|
||||||
@ -61,7 +62,8 @@ class RoutersTestDVR(RoutersTestDVRBase):
|
|||||||
|
|
||||||
@decorators.idempotent_id('8a0a72b4-7290-4677-afeb-b4ffe37bc352')
|
@decorators.idempotent_id('8a0a72b4-7290-4677-afeb-b4ffe37bc352')
|
||||||
def test_centralized_router_creation(self):
|
def test_centralized_router_creation(self):
|
||||||
"""
|
"""Test centralized router creation
|
||||||
|
|
||||||
Test uses administrative credentials to creates a
|
Test uses administrative credentials to creates a
|
||||||
CVR (Centralized Virtual Routing) router using the
|
CVR (Centralized Virtual Routing) router using the
|
||||||
distributed=False.
|
distributed=False.
|
||||||
@ -84,7 +86,8 @@ class RouterTestCentralizedToDVR(RoutersTestDVRBase):
|
|||||||
|
|
||||||
@decorators.idempotent_id('acd43596-c1fb-439d-ada8-31ad48ae3c2e')
|
@decorators.idempotent_id('acd43596-c1fb-439d-ada8-31ad48ae3c2e')
|
||||||
def test_centralized_router_update_to_dvr(self):
|
def test_centralized_router_update_to_dvr(self):
|
||||||
"""
|
"""Test centralized to DVR router update
|
||||||
|
|
||||||
Test uses administrative credentials to creates a
|
Test uses administrative credentials to creates a
|
||||||
CVR (Centralized Virtual Routing) router using the
|
CVR (Centralized Virtual Routing) router using the
|
||||||
distributed=False.Then it will "update" the router
|
distributed=False.Then it will "update" the router
|
||||||
|
@ -40,7 +40,8 @@ class RoutersTestHA(base.BaseRouterTest):
|
|||||||
|
|
||||||
@decorators.idempotent_id('8abc177d-14f1-4018-9f01-589b299cbee1')
|
@decorators.idempotent_id('8abc177d-14f1-4018-9f01-589b299cbee1')
|
||||||
def test_ha_router_creation(self):
|
def test_ha_router_creation(self):
|
||||||
"""
|
"""Test HA router creation
|
||||||
|
|
||||||
Test uses administrative credentials to create a
|
Test uses administrative credentials to create a
|
||||||
HA (High Availability) router using the ha=True.
|
HA (High Availability) router using the ha=True.
|
||||||
|
|
||||||
@ -53,7 +54,8 @@ class RoutersTestHA(base.BaseRouterTest):
|
|||||||
|
|
||||||
@decorators.idempotent_id('97b5f7ef-2192-4fa3-901e-979cd5c1097a')
|
@decorators.idempotent_id('97b5f7ef-2192-4fa3-901e-979cd5c1097a')
|
||||||
def test_legacy_router_creation(self):
|
def test_legacy_router_creation(self):
|
||||||
"""
|
"""Test legacy router creation
|
||||||
|
|
||||||
Test uses administrative credentials to create a
|
Test uses administrative credentials to create a
|
||||||
SF (Single Failure) router using the ha=False.
|
SF (Single Failure) router using the ha=False.
|
||||||
|
|
||||||
@ -68,7 +70,8 @@ class RoutersTestHA(base.BaseRouterTest):
|
|||||||
|
|
||||||
@decorators.idempotent_id('5a6bfe82-5b23-45a4-b027-5160997d4753')
|
@decorators.idempotent_id('5a6bfe82-5b23-45a4-b027-5160997d4753')
|
||||||
def test_legacy_router_update_to_ha(self):
|
def test_legacy_router_update_to_ha(self):
|
||||||
"""
|
"""Test legacy to HA router update
|
||||||
|
|
||||||
Test uses administrative credentials to create a
|
Test uses administrative credentials to create a
|
||||||
SF (Single Failure) router using the ha=False.
|
SF (Single Failure) router using the ha=False.
|
||||||
Then it will "update" the router ha attribute to True
|
Then it will "update" the router ha attribute to True
|
||||||
|
@ -34,8 +34,7 @@ CONF = config.CONF
|
|||||||
|
|
||||||
class BaseNetworkTest(test.BaseTestCase):
|
class BaseNetworkTest(test.BaseTestCase):
|
||||||
|
|
||||||
"""
|
"""Base class for Neutron tests that use the Tempest Neutron REST client
|
||||||
Base class for the Neutron tests that use the Tempest Neutron REST client
|
|
||||||
|
|
||||||
Per the Neutron API Guide, API v1.x was removed from the source code tree
|
Per the Neutron API Guide, API v1.x was removed from the source code tree
|
||||||
(docs.openstack.org/api/openstack-network/2.0/content/Overview-d1e71.html)
|
(docs.openstack.org/api/openstack-network/2.0/content/Overview-d1e71.html)
|
||||||
|
@ -29,9 +29,7 @@ CONF = config.CONF
|
|||||||
|
|
||||||
|
|
||||||
class Manager(manager.Manager):
|
class Manager(manager.Manager):
|
||||||
"""
|
"""Top level manager for OpenStack tempest clients"""
|
||||||
Top level manager for OpenStack tempest clients
|
|
||||||
"""
|
|
||||||
default_params = {
|
default_params = {
|
||||||
'disable_ssl_certificate_validation':
|
'disable_ssl_certificate_validation':
|
||||||
CONF.identity.disable_ssl_certificate_validation,
|
CONF.identity.disable_ssl_certificate_validation,
|
||||||
|
@ -20,7 +20,8 @@ from neutron_tempest_plugin.api import base
|
|||||||
|
|
||||||
class AllowedAddressPairTestJSON(base.BaseNetworkTest):
|
class AllowedAddressPairTestJSON(base.BaseNetworkTest):
|
||||||
|
|
||||||
"""
|
"""AllowedAddressPairTestJSON class
|
||||||
|
|
||||||
Tests the Neutron Allowed Address Pair API extension using the Tempest
|
Tests the Neutron Allowed Address Pair API extension using the Tempest
|
||||||
REST client. The following API operations are tested with this extension:
|
REST client. The following API operations are tested with this extension:
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ from neutron_tempest_plugin.api import base
|
|||||||
|
|
||||||
|
|
||||||
class TestAutoAllocatedTopology(base.BaseAdminNetworkTest):
|
class TestAutoAllocatedTopology(base.BaseAdminNetworkTest):
|
||||||
|
"""Tests Get-Me-A-Network
|
||||||
|
|
||||||
"""
|
|
||||||
Tests the Get-Me-A-Network operations in the Neutron API
|
Tests the Get-Me-A-Network operations in the Neutron API
|
||||||
using the REST client for Neutron.
|
using the REST client for Neutron.
|
||||||
"""
|
"""
|
||||||
|
@ -20,8 +20,8 @@ from neutron_tempest_plugin.api import base
|
|||||||
|
|
||||||
|
|
||||||
class ExtraDHCPOptionsTestJSON(base.BaseNetworkTest):
|
class ExtraDHCPOptionsTestJSON(base.BaseNetworkTest):
|
||||||
|
"""Test Extra DHCP Options
|
||||||
|
|
||||||
"""
|
|
||||||
Tests the following operations with the Extra DHCP Options Neutron API
|
Tests the following operations with the Extra DHCP Options Neutron API
|
||||||
extension:
|
extension:
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@ from neutron_tempest_plugin.api import base
|
|||||||
|
|
||||||
|
|
||||||
class TestFlavorsJson(base.BaseAdminNetworkTest):
|
class TestFlavorsJson(base.BaseAdminNetworkTest):
|
||||||
|
"""Test Flavors
|
||||||
|
|
||||||
"""
|
|
||||||
Tests the following operations in the Neutron API using the REST client for
|
Tests the following operations in the Neutron API using the REST client for
|
||||||
Neutron:
|
Neutron:
|
||||||
|
|
||||||
|
@ -23,8 +23,8 @@ LONG_NAME_OK = 'x' * db_const.NAME_FIELD_SIZE
|
|||||||
|
|
||||||
|
|
||||||
class MeteringTestJSON(base.BaseAdminNetworkTest):
|
class MeteringTestJSON(base.BaseAdminNetworkTest):
|
||||||
|
"""Test Metering
|
||||||
|
|
||||||
"""
|
|
||||||
Tests the following operations in the Neutron API using the REST client for
|
Tests the following operations in the Neutron API using the REST client for
|
||||||
Neutron:
|
Neutron:
|
||||||
|
|
||||||
|
@ -37,8 +37,8 @@ DELETE_SLEEP = 2
|
|||||||
|
|
||||||
|
|
||||||
class NetworksIpAvailabilityTest(base.BaseAdminNetworkTest):
|
class NetworksIpAvailabilityTest(base.BaseAdminNetworkTest):
|
||||||
|
"""Tests Networks IP Availability
|
||||||
|
|
||||||
"""
|
|
||||||
Tests the following operations in the Neutron API using the REST client for
|
Tests the following operations in the Neutron API using the REST client for
|
||||||
Neutron:
|
Neutron:
|
||||||
|
|
||||||
|
@ -22,8 +22,8 @@ from neutron_tempest_plugin import config
|
|||||||
|
|
||||||
|
|
||||||
class NetworksTestJSON(base.BaseNetworkTest):
|
class NetworksTestJSON(base.BaseNetworkTest):
|
||||||
|
"""Test Networks
|
||||||
|
|
||||||
"""
|
|
||||||
Tests the following operations in the Neutron API using the REST client for
|
Tests the following operations in the Neutron API using the REST client for
|
||||||
Neutron:
|
Neutron:
|
||||||
|
|
||||||
|
@ -58,7 +58,8 @@ class SubnetPoolsTest(SubnetPoolsTestBase):
|
|||||||
new_prefix = u'10.11.15.0/24'
|
new_prefix = u'10.11.15.0/24'
|
||||||
larger_prefix = u'10.11.0.0/16'
|
larger_prefix = u'10.11.0.0/16'
|
||||||
|
|
||||||
"""
|
"""Test Subnet Pools
|
||||||
|
|
||||||
Tests the following operations in the Neutron API using the REST client for
|
Tests the following operations in the Neutron API using the REST client for
|
||||||
Neutron:
|
Neutron:
|
||||||
|
|
||||||
@ -327,9 +328,7 @@ class SubnetPoolsTest(SubnetPoolsTestBase):
|
|||||||
@decorators.idempotent_id('4c6963c2-f54c-4347-b288-75d18421c4c4')
|
@decorators.idempotent_id('4c6963c2-f54c-4347-b288-75d18421c4c4')
|
||||||
@utils.requires_ext(extension='default-subnetpools', service='network')
|
@utils.requires_ext(extension='default-subnetpools', service='network')
|
||||||
def test_tenant_create_non_default_subnetpool(self):
|
def test_tenant_create_non_default_subnetpool(self):
|
||||||
"""
|
"""Test creates a subnetpool, the "is_default" attribute is False."""
|
||||||
Test creates a subnetpool, the "is_default" attribute is False.
|
|
||||||
"""
|
|
||||||
created_subnetpool = self._create_subnetpool()
|
created_subnetpool = self._create_subnetpool()
|
||||||
self.assertFalse(created_subnetpool['is_default'])
|
self.assertFalse(created_subnetpool['is_default'])
|
||||||
|
|
||||||
|
@ -54,8 +54,8 @@ class LockWithTimer(object):
|
|||||||
|
|
||||||
|
|
||||||
def wait_until_true(predicate, timeout=60, sleep=1, exception=None):
|
def wait_until_true(predicate, timeout=60, sleep=1, exception=None):
|
||||||
"""
|
"""Wait until callable predicate is evaluated as True
|
||||||
Wait until callable predicate is evaluated as True
|
|
||||||
:param predicate: Callable deciding whether waiting should continue.
|
:param predicate: Callable deciding whether waiting should continue.
|
||||||
Best practice is to instantiate predicate with functools.partial()
|
Best practice is to instantiate predicate with functools.partial()
|
||||||
:param timeout: Timeout in seconds how long should function wait.
|
:param timeout: Timeout in seconds how long should function wait.
|
||||||
|
@ -19,8 +19,8 @@ from tempest.lib import exceptions as lib_exc
|
|||||||
|
|
||||||
|
|
||||||
class NetworkClientJSON(service_client.RestClient):
|
class NetworkClientJSON(service_client.RestClient):
|
||||||
|
"""NetworkClientJSON class
|
||||||
|
|
||||||
"""
|
|
||||||
Tempest REST client for Neutron. Uses v2 of the Neutron API, since the
|
Tempest REST client for Neutron. Uses v2 of the Neutron API, since the
|
||||||
V1 API has been removed from the code base.
|
V1 API has been removed from the code base.
|
||||||
|
|
||||||
@ -447,7 +447,8 @@ class NetworkClientJSON(service_client.RestClient):
|
|||||||
return service_client.ResponseBody(resp, body)
|
return service_client.ResponseBody(resp, body)
|
||||||
|
|
||||||
def update_agent(self, agent_id, agent_info):
|
def update_agent(self, agent_id, agent_info):
|
||||||
"""
|
"""Update an agent
|
||||||
|
|
||||||
:param agent_info: Agent update information.
|
:param agent_info: Agent update information.
|
||||||
E.g {"admin_state_up": True}
|
E.g {"admin_state_up": True}
|
||||||
"""
|
"""
|
||||||
|
3
tox.ini
3
tox.ini
@ -57,10 +57,9 @@ commands = oslo_debug_helper -t neutron_tempest_plugin/ {posargs}
|
|||||||
# E128 continuation line under-indented for visual indent
|
# E128 continuation line under-indented for visual indent
|
||||||
# E129 visually indented line with same indent as next logical line
|
# E129 visually indented line with same indent as next logical line
|
||||||
# E265 block comment should start with '# '
|
# E265 block comment should start with '# '
|
||||||
# H404 multi line docstring should start with a summary
|
|
||||||
# H405 multi line docstring summary not separated with an empty line
|
# H405 multi line docstring summary not separated with an empty line
|
||||||
# N530 direct neutron imports not allowed
|
# N530 direct neutron imports not allowed
|
||||||
ignore = E125,E126,E128,E129,E265,H404,H405,N530
|
ignore = E125,E126,E128,E129,E265,H405,N530
|
||||||
# H106: Don't put vim configuration in source files
|
# H106: Don't put vim configuration in source files
|
||||||
# H203: Use assertIs(Not)None to check for None
|
# H203: Use assertIs(Not)None to check for None
|
||||||
# H904: Delay string interpolations at logging calls
|
# H904: Delay string interpolations at logging calls
|
||||||
|
Loading…
Reference in New Issue
Block a user