From 77aa4399225023d3bec107d95aeada0e386f96da Mon Sep 17 00:00:00 2001 From: Daniel <d.hornung@indiscale.com> Date: Mon, 8 May 2023 12:22:16 +0200 Subject: [PATCH] Styling and linting. --- src/linkahead/common/administration.py | 4 ++-- src/linkahead/common/models.py | 10 +++++----- src/linkahead/utils/server_side_scripting.py | 2 +- unittests/test_entity.py | 2 +- unittests/test_error_handling.py | 10 +++++----- unittests/test_high_level_api.py | 18 +++++++++--------- unittests/test_yamlapi.py | 4 ++-- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/linkahead/common/administration.py b/src/linkahead/common/administration.py index c23a61a5..20ebe1ab 100644 --- a/src/linkahead/common/administration.py +++ b/src/linkahead/common/administration.py @@ -32,8 +32,8 @@ import random from linkahead.common.utils import xml2str from linkahead.connection.connection import get_connection from linkahead.exceptions import (EntityDoesNotExistError, HTTPClientError, - HTTPForbiddenError, HTTPResourceNotFoundError, - ServerConfigurationException) + HTTPForbiddenError, HTTPResourceNotFoundError, + ServerConfigurationException) from lxml import etree diff --git a/src/linkahead/common/models.py b/src/linkahead/common/models.py index 38a327a9..01f77e97 100644 --- a/src/linkahead/common/models.py +++ b/src/linkahead/common/models.py @@ -3451,12 +3451,12 @@ class Container(list): uri1, uri2 = Container._split_uri_string(entities) except ValueError as val_e: raise uri_e from val_e - c1 = self._retrieve(entities=uri1, flags=flags) - c2 = self._retrieve(entities=uri2, flags=flags) - c1.extend(c2) - c1.messages.extend(c2.messages) + c1 = self._retrieve(entities=uri1, flags=flags) + c2 = self._retrieve(entities=uri2, flags=flags) + c1.extend(c2) + c1.messages.extend(c2.messages) - return c1 + return c1 def clear_server_messages(self): self.messages.clear_server_messages() diff --git a/src/linkahead/utils/server_side_scripting.py b/src/linkahead/utils/server_side_scripting.py index 6a419191..06caa3d9 100644 --- a/src/linkahead/utils/server_side_scripting.py +++ b/src/linkahead/utils/server_side_scripting.py @@ -31,7 +31,7 @@ from lxml import etree from linkahead.connection.connection import get_connection from linkahead.connection.utils import urlencode from linkahead.connection.encode import (MultipartParam, multipart_encode, - ReadableMultiparts) + ReadableMultiparts) def _make_params(pos_args, opts): diff --git a/unittests/test_entity.py b/unittests/test_entity.py index f91613a0..abf82f0a 100644 --- a/unittests/test_entity.py +++ b/unittests/test_entity.py @@ -28,7 +28,7 @@ from lxml import etree import os from linkahead import (INTEGER, Entity, Property, Record, RecordType, - configure_connection) + configure_connection) from linkahead.connection.mockup import MockUpServerConnection UNITTESTDIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/unittests/test_error_handling.py b/unittests/test_error_handling.py index 590755b9..3f524146 100644 --- a/unittests/test_error_handling.py +++ b/unittests/test_error_handling.py @@ -29,11 +29,11 @@ children. import linkahead as db from linkahead.common.models import raise_errors from linkahead.exceptions import (AuthorizationError, - EntityDoesNotExistError, EntityError, - EntityHasNoDatatypeError, - TransactionError, UniqueNamesError, - UnqualifiedParentsError, - UnqualifiedPropertiesError) + EntityDoesNotExistError, EntityError, + EntityHasNoDatatypeError, + TransactionError, UniqueNamesError, + UnqualifiedParentsError, + UnqualifiedPropertiesError) from pytest import raises diff --git a/unittests/test_high_level_api.py b/unittests/test_high_level_api.py index f1c4b18c..f3d568fd 100644 --- a/unittests/test_high_level_api.py +++ b/unittests/test_high_level_api.py @@ -25,19 +25,19 @@ import linkahead as db from linkahead.high_level_api import (convert_to_entity, convert_to_python_object, - new_high_level_entity) + new_high_level_entity) from linkahead.high_level_api import (LinkAheadPythonUnresolvedParent, - LinkAheadPythonUnresolvedReference, - LinkAheadPythonRecord, LinkAheadPythonFile, - high_level_type_for_standard_type, - standard_type_for_high_level_type, - high_level_type_for_role, - LinkAheadPythonEntity) + LinkAheadPythonUnresolvedReference, + LinkAheadPythonRecord, LinkAheadPythonFile, + high_level_type_for_standard_type, + standard_type_for_high_level_type, + high_level_type_for_role, + LinkAheadPythonEntity) from linkahead.apiutils import compare_entities from linkahead.common.datatype import (is_list_datatype, - get_list_datatype, - is_reference) + get_list_datatype, + is_reference) import pytest from lxml import etree diff --git a/unittests/test_yamlapi.py b/unittests/test_yamlapi.py index 0b0aca47..027e5750 100644 --- a/unittests/test_yamlapi.py +++ b/unittests/test_yamlapi.py @@ -23,8 +23,8 @@ import os import warnings import tempfile from linkahead.yamlapi import (append_sublist, kv_to_xml, - dict_to_xml, yaml_to_xml, - process, yaml_file_to_xml) + dict_to_xml, yaml_to_xml, + process, yaml_file_to_xml) with warnings.catch_warnings(record=True) as w: # Cause all warnings to always be triggered. -- GitLab