Fix W605 Warning and reenable flake8 (#1334)

This commit is contained in:
micw523
2018-10-27 22:16:54 -05:00
committed by William Cheng
parent d61a14cab9
commit 107467497c
16 changed files with 41 additions and 41 deletions

View File

@@ -599,7 +599,7 @@ class FakeApi(object):
collection_formats=collection_formats)
def test_client_model(self, client, **kwargs): # noqa: E501
"""To test \"client\" model # noqa: E501
"""To test \"client\" model # noqa: E501
To test \"client\" model # noqa: E501
This method makes a synchronous HTTP request by default. To make an
@@ -621,7 +621,7 @@ class FakeApi(object):
return data
def test_client_model_with_http_info(self, client, **kwargs): # noqa: E501
"""To test \"client\" model # noqa: E501
"""To test \"client\" model # noqa: E501
To test \"client\" model # noqa: E501
This method makes a synchronous HTTP request by default. To make an
@@ -803,7 +803,7 @@ class FakeApi(object):
raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501
if 'double' in local_var_params and local_var_params['double'] < 67.8: # noqa: E501
raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501
if 'pattern_without_delimiter' in local_var_params and not re.search('^[A-Z].*', local_var_params['pattern_without_delimiter']): # noqa: E501
if 'pattern_without_delimiter' in local_var_params and not re.search(r'^[A-Z].*', local_var_params['pattern_without_delimiter']): # noqa: E501
raise ValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501
if 'integer' in local_var_params and local_var_params['integer'] > 100: # noqa: E501
raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501
@@ -815,7 +815,7 @@ class FakeApi(object):
raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501
if 'float' in local_var_params and local_var_params['float'] > 987.6: # noqa: E501
raise ValueError("Invalid value for parameter `float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501
if 'string' in local_var_params and not re.search('[a-z]', local_var_params['string'], flags=re.IGNORECASE): # noqa: E501
if 'string' in local_var_params and not re.search(r'[a-z]', local_var_params['string'], flags=re.IGNORECASE): # noqa: E501
raise ValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501
if ('password' in local_var_params and
len(local_var_params['password']) > 64):

View File

@@ -244,12 +244,12 @@ class ApiClient(object):
if type(klass) == str:
if klass.startswith('list['):
sub_kls = re.match('list\[(.*)\]', klass).group(1)
sub_kls = re.match(r'list\[(.*)\]', klass).group(1)
return [self.__deserialize(sub_data, sub_kls)
for sub_data in data]
if klass.startswith('dict('):
sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2)
sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
return {k: self.__deserialize(v, sub_kls)
for k, v in six.iteritems(data)}

View File

@@ -269,8 +269,8 @@ class FormatTest(object):
:param string: The string of this FormatTest. # noqa: E501
:type: str
"""
if string is not None and not re.search('[a-z]', string, flags=re.IGNORECASE): # noqa: E501
raise ValueError("Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501
if string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE): # noqa: E501
raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501
self._string = string
@@ -294,8 +294,8 @@ class FormatTest(object):
"""
if byte is None:
raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501
if byte is not None and not re.search('^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): # noqa: E501
raise ValueError("Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501
if byte is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): # noqa: E501
raise ValueError(r"Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501
self._byte = byte

View File

@@ -24,7 +24,7 @@ python setup.py develop
tox || exit 1
### static analysis of code
#flake8 --show-source petstore_api/
flake8 --show-source petstore_api/
### deactivate virtualenv
#if [ $DEACTIVE == true ]; then