diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-12-07 21:28:19 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:54 +0100 |
commit | 7d32ae52ce18b2dbf444348d8403bfd7b919f94a (patch) | |
tree | 205ce41d5813cfd63a4a5fd98c7e3fae6f371495 /tests | |
parent | dffe92540223819fb046a377fa5304f1023dd924 (diff) | |
download | wee-slack-7d32ae52ce18b2dbf444348d8403bfd7b919f94a.tar.gz |
Fix ruff lint errors
Diffstat (limited to 'tests')
-rw-r--r-- | tests/conftest.py | 20 | ||||
-rw-r--r-- | tests/test_http_request.py | 20 |
2 files changed, 20 insertions, 20 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index 46dd6fe..891dc67 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -38,16 +38,16 @@ def import_stub(stubs_path: str, module_name: str): import_stub("typings", "weechat") -import weechat - -from slack.config import SlackConfig -from slack.shared import shared -from slack.slack_conversation import SlackConversation -from slack.slack_emoji import load_standard_emojis -from slack.slack_message import PendingMessageItem, SlackMessage -from slack.slack_user import SlackUser -from slack.slack_workspace import SlackWorkspace -from slack.task import Future +import weechat # noqa: E402 + +from slack.config import SlackConfig # noqa: E402 +from slack.shared import shared # noqa: E402 +from slack.slack_conversation import SlackConversation # noqa: E402 +from slack.slack_emoji import load_standard_emojis # noqa: E402 +from slack.slack_message import PendingMessageItem, SlackMessage # noqa: E402 +from slack.slack_user import SlackUser # noqa: E402 +from slack.slack_workspace import SlackWorkspace # noqa: E402 +from slack.task import Future # noqa: E402 config_values: Dict[str, str] = { "replace_space_in_nicks_with": "_", diff --git a/tests/test_http_request.py b/tests/test_http_request.py index 42d2058..1d87df9 100644 --- a/tests/test_http_request.py +++ b/tests/test_http_request.py @@ -54,7 +54,7 @@ def test_http_request_process_success(mock_method: MagicMock): future.id, ) - body = f"HTTP/2 200\r\n\r\nresponse" + body = "HTTP/2 200\r\n\r\nresponse" future.set_result(("", 0, body, "")) with pytest.raises(StopIteration) as excinfo: @@ -74,8 +74,8 @@ def test_http_request_url_error(): coroutine.send(None) assert excinfo.value.url == url - assert excinfo.value.return_code == None - assert excinfo.value.http_status_code == None + assert excinfo.value.return_code is None + assert excinfo.value.http_status_code is None assert excinfo.value.error == "error" @@ -92,7 +92,7 @@ def test_http_request_process_error_return_code(): assert excinfo.value.url == url assert excinfo.value.return_code == -2 - assert excinfo.value.http_status_code == None + assert excinfo.value.http_status_code is None assert excinfo.value.error == "" @@ -109,7 +109,7 @@ def test_http_request_process_error_stderr(): assert excinfo.value.url == url assert excinfo.value.return_code == 0 - assert excinfo.value.http_status_code == None + assert excinfo.value.http_status_code is None assert excinfo.value.error == "err" @@ -128,7 +128,7 @@ def test_http_request_error_http_status(): coroutine.send(None) assert excinfo.value.url == url - assert excinfo.value.return_code == None + assert excinfo.value.return_code is None assert excinfo.value.http_status_code == 400 assert excinfo.value.error == "response" @@ -185,8 +185,8 @@ def test_http_request_error_retry_error(): coroutine.send(None) assert excinfo.value.url == url - assert excinfo.value.return_code == None - assert excinfo.value.http_status_code == None + assert excinfo.value.return_code is None + assert excinfo.value.http_status_code is None assert excinfo.value.error == "error" @@ -198,7 +198,7 @@ def test_http_request_url_multiple_headers(): headers = ( dedent( - f""" + """ HTTP/1.1 200 Connection established HTTP/2 200 @@ -229,7 +229,7 @@ def test_http_request_process_multiple_headers(): body = ( dedent( - f""" + """ HTTP/1.1 200 Connection established HTTP/2 200 |