1
0
mirror of https://github.com/httpie/cli.git synced 2025-08-10 22:42:05 +02:00

Modernize the code base with f-strings in tests (#1069)

Simple concatenations were kept for readability purpose.
This commit is contained in:
Mickaël Schoentgen
2021-05-26 14:09:38 +02:00
committed by GitHub
parent 0ff0874fa3
commit 264d45cdf5
10 changed files with 42 additions and 42 deletions

View File

@@ -41,7 +41,7 @@ def mk_config_dir() -> Path:
def add_auth(url, auth):
proto, rest = url.split('://', 1)
return proto + '://' + auth + '@' + rest
return f'{proto}://{auth}@{rest}'
class StdinBytesIO(BytesIO):

View File

@@ -15,7 +15,7 @@ def test_assert_output_matches_headers_unterminated():
assert_output_does_not_match(
(
f'HTTP/1.1{CRLF}'
f'AAA:BBB'
'AAA:BBB'
f'{CRLF}'
),
[Expect.RESPONSE_HEADERS],
@@ -90,7 +90,7 @@ def test_assert_output_matches_headers_and_body():
f'HTTP/1.1{CRLF}'
f'AAA:BBB{CRLF}'
f'{CRLF}'
f'CCC'
'CCC'
),
[Expect.RESPONSE_HEADERS, Expect.BODY]
)
@@ -121,7 +121,7 @@ def test_assert_output_matches_multiple_messages():
f'EEE:FFF{CRLF}'
f'{CRLF}'
f'GGG'
'GGG'
f'{MESSAGE_SEPARATOR}'
), [
Expect.REQUEST_HEADERS,