Skip to content

Commit

Permalink
Fix ruff and black complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Jul 18, 2023
1 parent cff63c1 commit 610122d
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 10 deletions.
2 changes: 0 additions & 2 deletions test/test_server_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ def test_server_prepare_post_body_optional_attributes(self):

@responses.activate
def test_create_server(self, manager):

responses.add(
responses.POST,
Mock.base_url + '/server',
Expand Down Expand Up @@ -213,7 +212,6 @@ def test_create_server_with_dict(self, manager):

@responses.activate
def test_create_server_from_template(self, manager):

UUID = '01215a5a-c330-4565-81ca-0e0e22eac672'

def _from_template_callback(request):
Expand Down
1 change: 0 additions & 1 deletion test/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ def test_cancel_storage_import(self, manager):

@responses.activate
def test_storage_update(self, manager):

Mock.mock_put("storage/01d4fcd4-e446-433b-8a9c-551a1284952e")
storage = manager.modify_storage(
"01d4fcd4-e446-433b-8a9c-551a1284952e", title="my bigger data collection", size=15
Expand Down
2 changes: 0 additions & 2 deletions test/test_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def test_get_tags(self, manager):

@responses.activate
def test_create_new_tag(self, manager):

for _ in range(1, 4):
responses.add_callback(
responses.POST,
Expand All @@ -69,7 +68,6 @@ def test_create_new_tag(self, manager):

@responses.activate
def test_edit_tag(self, manager):

Mock.mock_get('tag/TheTestTag')
tag = manager.get_tag('TheTestTag')

Expand Down
1 change: 1 addition & 0 deletions upcloud_api/cloud_manager/server_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def create_server(self, server: Server) -> Server:
serialised into JSON. Refer to the REST API documentation for correct format.
Example:
-------
server1 = Server( core_number = 1,
memory_amount = 1024,
hostname = "my.example.1",
Expand Down
3 changes: 2 additions & 1 deletion upcloud_api/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ class UpCloudClientError(Exception):


class UpCloudAPIError(UpCloudClientError):
"""Custom Error class for UpCloud API error responses.
"""
Custom Error class for UpCloud API error responses.
Each API call returns an `error_code` and `error_message` that
are available as attributes via instances of this class.
Expand Down
3 changes: 2 additions & 1 deletion upcloud_api/ip_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ class IPAddress(UpCloudResource):
"""
Class representation of the API's IP address. Extends UpCloudResource.
Attributes:
Attributes
----------
access -- "public" or "private"
address -- the actual IPAddress (string)
family -- IPv4 or IPv6
Expand Down
3 changes: 2 additions & 1 deletion upcloud_api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ def prepare_post_body(self):
# set password_delivery default as 'none' to prevent API from sending
# emails (with credentials) about each created server
if not hasattr(self, 'password_delivery'):
body['server']['password_delivery'] = 'none'
# noqa reason: no, this is not a hard-coded password
body['server']['password_delivery'] = 'none' # noqa: S105

# collect storage devices and create a unique title (see: Storage.title in API doc)
# for each of them
Expand Down
1 change: 0 additions & 1 deletion upcloud_api/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ def to_dict(self):

@staticmethod
def _create_storage_objs(storages, cloud_manager):

# storages might be provided as a flat array or as a following dict:
# {'storage_devices': {'storage_device': [...]}} || {'storage_device': [...]}

Expand Down
3 changes: 2 additions & 1 deletion upcloud_api/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ class Tag(UpCloudResource):
"""
Class representation of the API's tags. Extends UpCloudResource.
Attributes:
Attributes
----------
name -- unique name for the tag
description -- optional description
servers -- list of Server objects (with only uuid populated)
Expand Down

0 comments on commit 610122d

Please sign in to comment.