Skip to content

Commit c145b93

Browse files
committed
Address linter warnings
1 parent 7b6a4d4 commit c145b93

File tree

8 files changed

+18
-19
lines changed

8 files changed

+18
-19
lines changed

gvm/http/core/_api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ def __init__(
2727
api_key: Optional API key for authentication
2828
"""
2929

30-
"The connector handling the HTTP(S) connection"
30+
3131
self._connector: HttpApiConnector = connector
32+
"The connector handling the HTTP(S) connection"
3233

33-
"Optional API key for authentication"
3434
self._api_key: Optional[str] = api_key
35+
"Optional API key for authentication"

gvm/http/core/connector.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"""
88

99
import urllib.parse
10-
from typing import Optional, Tuple, Dict, Any
10+
from typing import Any, Dict, Optional, Tuple
1111

1212
from requests import Session
1313

@@ -36,8 +36,8 @@ def url_join(cls, base: str, rel_path: str) -> str:
3636
"""
3737
if base.endswith("/"):
3838
return urllib.parse.urljoin(base, rel_path)
39-
else:
40-
return urllib.parse.urljoin(base + "/", rel_path)
39+
40+
return urllib.parse.urljoin(base + "/", rel_path)
4141

4242
def __init__(
4343
self,

gvm/http/core/headers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"""
88

99
from dataclasses import dataclass
10-
from typing import Self, Dict, Optional
10+
from typing import Dict, Optional, Self
1111

1212

1313
@dataclass
@@ -45,8 +45,8 @@ def from_string(
4545
if header_string:
4646
parts = header_string.split(";")
4747
media_type = parts[0].strip()
48-
for param in parts[1:]:
49-
param = param.strip()
48+
for part in parts[1:]:
49+
param = part.strip()
5050
if "=" in param:
5151
key, value = map(lambda x: x.strip(), param.split("=", 1))
5252
params[key] = value

gvm/http/core/response.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
"""
88

99
from dataclasses import dataclass
10-
from typing import Any, Dict, Self, Optional
11-
from requests import Request, Response
10+
from typing import Any, Dict, Optional, Self
11+
12+
from requests import Response
1213

1314
from gvm.http.core.headers import ContentType
1415

gvm/http/openvasd/openvasd1.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
"""
88

99
import urllib.parse
10-
from typing import Optional, Any
10+
from typing import Any, Optional
1111

1212
from gvm.errors import InvalidArgumentType
13-
1413
from gvm.http.core._api import GvmHttpApi
1514
from gvm.http.core.connector import HttpApiConnector
1615
from gvm.http.core.response import HttpResponse

tests/http/core/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: GPL-3.0-or-later
44

55
import unittest
6-
from unittest.mock import patch, MagicMock
6+
from unittest.mock import MagicMock, patch
77

88
from gvm.http.core._api import GvmHttpApi
99

tests/http/core/test_connector.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@
44
import json
55
import unittest
66
from http import HTTPStatus
7-
from typing import Optional, Any
8-
from unittest.mock import patch, MagicMock, Mock
9-
from requests.exceptions import HTTPError
7+
from typing import Any, Optional
8+
from unittest.mock import MagicMock, Mock, patch
109

11-
from gvm.http.core.connector import HttpApiConnector
1210
import requests as requests_lib
11+
from requests.exceptions import HTTPError
1312

13+
from gvm.http.core.connector import HttpApiConnector
1414
from gvm.http.core.headers import ContentType
1515

16-
1716
TEST_JSON_HEADERS = {
1817
"content-type": "application/json;charset=utf-8",
1918
"x-example": "some-test-header",

tests/http/openvasd/test_openvasd1.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from unittest.mock import Mock, patch
99

1010
from gvm.errors import InvalidArgumentType
11-
1211
from gvm.http.core.headers import ContentType
1312
from gvm.http.core.response import HttpResponse
1413
from gvm.http.openvasd.openvasd1 import OpenvasdHttpApiV1

0 commit comments

Comments
 (0)