Skip to content

Commit 610122d

Browse files
committed
Fix ruff and black complaints
1 parent cff63c1 commit 610122d

File tree

9 files changed

+9
-10
lines changed

9 files changed

+9
-10
lines changed

test/test_server_creation.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ def test_server_prepare_post_body_optional_attributes(self):
138138

139139
@responses.activate
140140
def test_create_server(self, manager):
141-
142141
responses.add(
143142
responses.POST,
144143
Mock.base_url + '/server',
@@ -213,7 +212,6 @@ def test_create_server_with_dict(self, manager):
213212

214213
@responses.activate
215214
def test_create_server_from_template(self, manager):
216-
217215
UUID = '01215a5a-c330-4565-81ca-0e0e22eac672'
218216

219217
def _from_template_callback(request):

test/test_storage.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ def test_cancel_storage_import(self, manager):
172172

173173
@responses.activate
174174
def test_storage_update(self, manager):
175-
176175
Mock.mock_put("storage/01d4fcd4-e446-433b-8a9c-551a1284952e")
177176
storage = manager.modify_storage(
178177
"01d4fcd4-e446-433b-8a9c-551a1284952e", title="my bigger data collection", size=15

test/test_tags.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def test_get_tags(self, manager):
4848

4949
@responses.activate
5050
def test_create_new_tag(self, manager):
51-
5251
for _ in range(1, 4):
5352
responses.add_callback(
5453
responses.POST,
@@ -69,7 +68,6 @@ def test_create_new_tag(self, manager):
6968

7069
@responses.activate
7170
def test_edit_tag(self, manager):
72-
7371
Mock.mock_get('tag/TheTestTag')
7472
tag = manager.get_tag('TheTestTag')
7573

upcloud_api/cloud_manager/server_mixin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def create_server(self, server: Server) -> Server:
8686
serialised into JSON. Refer to the REST API documentation for correct format.
8787
8888
Example:
89+
-------
8990
server1 = Server( core_number = 1,
9091
memory_amount = 1024,
9192
hostname = "my.example.1",

upcloud_api/errors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ class UpCloudClientError(Exception):
1010

1111

1212
class UpCloudAPIError(UpCloudClientError):
13-
"""Custom Error class for UpCloud API error responses.
13+
"""
14+
Custom Error class for UpCloud API error responses.
1415
1516
Each API call returns an `error_code` and `error_message` that
1617
are available as attributes via instances of this class.

upcloud_api/ip_address.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ class IPAddress(UpCloudResource):
55
"""
66
Class representation of the API's IP address. Extends UpCloudResource.
77
8-
Attributes:
8+
Attributes
9+
----------
910
access -- "public" or "private"
1011
address -- the actual IPAddress (string)
1112
family -- IPv4 or IPv6

upcloud_api/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,8 @@ def prepare_post_body(self):
338338
# set password_delivery default as 'none' to prevent API from sending
339339
# emails (with credentials) about each created server
340340
if not hasattr(self, 'password_delivery'):
341-
body['server']['password_delivery'] = 'none'
341+
# noqa reason: no, this is not a hard-coded password
342+
body['server']['password_delivery'] = 'none' # noqa: S105
342343

343344
# collect storage devices and create a unique title (see: Storage.title in API doc)
344345
# for each of them

upcloud_api/storage.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ def to_dict(self):
150150

151151
@staticmethod
152152
def _create_storage_objs(storages, cloud_manager):
153-
154153
# storages might be provided as a flat array or as a following dict:
155154
# {'storage_devices': {'storage_device': [...]}} || {'storage_device': [...]}
156155

upcloud_api/tag.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ class Tag(UpCloudResource):
66
"""
77
Class representation of the API's tags. Extends UpCloudResource.
88
9-
Attributes:
9+
Attributes
10+
----------
1011
name -- unique name for the tag
1112
description -- optional description
1213
servers -- list of Server objects (with only uuid populated)

0 commit comments

Comments
 (0)