mirror of
https://github.com/httpie/cli.git
synced 2024-11-22 15:53:13 +01:00
Fix several issues found with flake8 (#1081)
This commit is contained in:
parent
8374a9ed83
commit
8d35a12d27
@ -709,7 +709,7 @@ ssl.add_argument(
|
|||||||
ssl.add_argument(
|
ssl.add_argument(
|
||||||
'--ssl',
|
'--ssl',
|
||||||
dest='ssl_version',
|
dest='ssl_version',
|
||||||
choices=list(sorted(AVAILABLE_SSL_VERSION_ARG_MAPPING.keys())),
|
choices=sorted(AVAILABLE_SSL_VERSION_ARG_MAPPING.keys()),
|
||||||
help='''
|
help='''
|
||||||
The desired protocol version to use. This will default to
|
The desired protocol version to use. This will default to
|
||||||
SSL v2.3 which will negotiate the highest protocol that both
|
SSL v2.3 which will negotiate the highest protocol that both
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import errno
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
10
setup.cfg
10
setup.cfg
@ -17,7 +17,13 @@ addopts = --tb=native --doctest-modules
|
|||||||
exclude = .git,.idea,__pycache__,build,dist,.pytest_cache,*.egg-info
|
exclude = .git,.idea,__pycache__,build,dist,.pytest_cache,*.egg-info
|
||||||
|
|
||||||
# <http://pycodestyle.pycqa.org/en/latest/intro.html#error-codes>
|
# <http://pycodestyle.pycqa.org/en/latest/intro.html#error-codes>
|
||||||
# E241 - multiple spaces after ','
|
|
||||||
# E501 - line too long
|
# E501 - line too long
|
||||||
# W503 - line break before binary operator
|
# W503 - line break before binary operator
|
||||||
ignore = E241,E501,W503
|
ignore = E501,W503
|
||||||
|
|
||||||
|
|
||||||
|
[flake8]
|
||||||
|
# <https://flake8.pycqa.org/en/latest/user/error-codes.html>
|
||||||
|
# E501 - line too long
|
||||||
|
# W503 - line break before binary operator
|
||||||
|
ignore = E501,W503
|
||||||
|
@ -18,7 +18,7 @@ SOURCE_DIRECTORIES = [
|
|||||||
def has_docutils():
|
def has_docutils():
|
||||||
try:
|
try:
|
||||||
# noinspection PyUnresolvedReferences,PyPackageRequirements
|
# noinspection PyUnresolvedReferences,PyPackageRequirements
|
||||||
import docutils
|
import docutils # noqa
|
||||||
return True
|
return True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
return False
|
return False
|
||||||
@ -35,7 +35,7 @@ def rst_filenames():
|
|||||||
os.chdir(cwd)
|
os.chdir(cwd)
|
||||||
|
|
||||||
|
|
||||||
filenames = list(sorted(rst_filenames()))
|
filenames = sorted(rst_filenames())
|
||||||
assert filenames
|
assert filenames
|
||||||
|
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ def test_form_POST_file_redirected_stdin(httpbin):
|
|||||||
<https://github.com/httpie/httpie/issues/840>
|
<https://github.com/httpie/httpie/issues/840>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
with open(FILE_PATH) as f:
|
with open(FILE_PATH):
|
||||||
r = http(
|
r = http(
|
||||||
'--form',
|
'--form',
|
||||||
'POST',
|
'POST',
|
||||||
|
@ -4,7 +4,6 @@ from unittest import mock
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import tempfile
|
|
||||||
import io
|
import io
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
|
|
||||||
|
@ -479,7 +479,7 @@ class TestCookieStorage(CookieTestBase):
|
|||||||
2. command line arg
|
2. command line arg
|
||||||
3. cookie already stored in session file
|
3. cookie already stored in session file
|
||||||
"""
|
"""
|
||||||
r = http(
|
http(
|
||||||
'--session', str(self.session_path),
|
'--session', str(self.session_path),
|
||||||
httpbin.url + set_cookie,
|
httpbin.url + set_cookie,
|
||||||
'Cookie:' + cli_cookie,
|
'Cookie:' + cli_cookie,
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
import os
|
|
||||||
import tempfile
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from httpie.context import Environment
|
from httpie.context import Environment
|
||||||
|
|
||||||
|
@ -69,19 +69,19 @@ def test_assert_output_matches_body_and_separator():
|
|||||||
|
|
||||||
|
|
||||||
def test_assert_output_matches_body_r():
|
def test_assert_output_matches_body_r():
|
||||||
assert_output_matches(f'AAA\r', [Expect.BODY])
|
assert_output_matches('AAA\r', [Expect.BODY])
|
||||||
|
|
||||||
|
|
||||||
def test_assert_output_matches_body_n():
|
def test_assert_output_matches_body_n():
|
||||||
assert_output_matches(f'AAA\n', [Expect.BODY])
|
assert_output_matches('AAA\n', [Expect.BODY])
|
||||||
|
|
||||||
|
|
||||||
def test_assert_output_matches_body_r_body():
|
def test_assert_output_matches_body_r_body():
|
||||||
assert_output_matches(f'AAA\rBBB', [Expect.BODY])
|
assert_output_matches('AAA\rBBB', [Expect.BODY])
|
||||||
|
|
||||||
|
|
||||||
def test_assert_output_matches_body_n_body():
|
def test_assert_output_matches_body_n_body():
|
||||||
assert_output_matches(f'AAA\nBBB', [Expect.BODY])
|
assert_output_matches('AAA\nBBB', [Expect.BODY])
|
||||||
|
|
||||||
|
|
||||||
def test_assert_output_matches_headers_and_body():
|
def test_assert_output_matches_headers_and_body():
|
||||||
|
Loading…
Reference in New Issue
Block a user