From d4fa56c4d2a2e5e1f99d522a31bcdf2f096df6d7 Mon Sep 17 00:00:00 2001 From: d-w-moore Date: Sat, 7 Jun 2025 16:04:13 -0400 Subject: [PATCH] [_5] run black on all Python source code. For future reference, the current "black --version" output for the black formatter used here was: python -m black, 25.1.0 (compiled: yes) Python (CPython) 3.12.4 --- irods/helpers/__init__.py | 2 ++ irods/test/data_obj_test.py | 6 +++--- irods/test/helpers.py | 12 +++++++----- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/irods/helpers/__init__.py b/irods/helpers/__init__.py index f60613e1..08050002 100644 --- a/irods/helpers/__init__.py +++ b/irods/helpers/__init__.py @@ -23,6 +23,7 @@ def __init__(self, *args, **kwargs): print("Aborting tests [ Got : %r ]" % self, file=sys.stderr) os.abort() + class iRODS_Server_Too_Recent_For_Testing(StopTestsException): pass @@ -35,6 +36,7 @@ def _get_server_version_for_test(session, curtail_length): # Create a connection for test, based on ~/.irods environment by default. + def make_session(test_server_version=False, **kwargs): """Connect to an iRODS server as determined by any client environment file present at a standard location, and by any keyword arguments given. diff --git a/irods/test/data_obj_test.py b/irods/test/data_obj_test.py index dfdcf82e..c69d7fd3 100644 --- a/irods/test/data_obj_test.py +++ b/irods/test/data_obj_test.py @@ -294,7 +294,7 @@ def write_and_check_replica_on_parallel_connections( data_object_path, "a", finalize_on_close=False, - **{kw.RESC_HIER_STR_KW: hier_str, kw.REPLICA_TOKEN_KW: replica_token} + **{kw.RESC_HIER_STR_KW: hier_str, kw.REPLICA_TOKEN_KW: replica_token}, ) fd2.seek(4) fd2.write(b"s\n") @@ -646,7 +646,7 @@ def test_compute_chksum(self): Data.put( f.name, dobj_path, - **{kw.DEST_RESC_NAME_KW: R, kw.FORCE_FLAG_KW: "1"} + **{kw.DEST_RESC_NAME_KW: R, kw.FORCE_FLAG_KW: "1"}, ) # compare checksums my_object = Data.get(dobj_path) @@ -2092,7 +2092,7 @@ def test_data_open_on_leaf_is_disallowed__243(self): self.sess.data_objects.open( "{home}/disallowed_243".format(**locals()), "w", - **{kw.RESC_NAME_KW: Leaf} + **{kw.RESC_NAME_KW: Leaf}, ) def test_data_open_on_named_resource__243(self): diff --git a/irods/test/helpers.py b/irods/test/helpers.py index 1ffb437f..4527d5bd 100644 --- a/irods/test/helpers.py +++ b/irods/test/helpers.py @@ -17,9 +17,7 @@ import threading import irods.client_configuration as config -from irods.helpers import ( - home_collection, - make_session as _irods_helpers_make_session) +from irods.helpers import home_collection, make_session as _irods_helpers_make_session from irods.message import iRODSMessage, IRODS_VERSION from irods.password_obfuscation import encode import irods.rule @@ -164,11 +162,15 @@ def recast(k): def make_session(test_server_version=True, **kwargs): - return _irods_helpers_make_session(test_server_version=test_server_version, **kwargs) + return _irods_helpers_make_session( + test_server_version=test_server_version, **kwargs + ) make_session.__doc__ = re.sub( - r"(test_server_version\s*)=\s*\w+", r"\1 = True", _irods_helpers_make_session.__doc__ + r"(test_server_version\s*)=\s*\w+", + r"\1 = True", + _irods_helpers_make_session.__doc__, )