Skip to content

Commit

Permalink
add test comments, change test names to be more descriptive
Browse files Browse the repository at this point in the history
  • Loading branch information
d-w-moore committed Jul 11, 2024
1 parent f4d8d6c commit cdfdc8e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions irods/test/data_obj_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2106,7 +2106,9 @@ def test_touch_operation_does_not_work_when_given_a_collection__525(self):
user_session.data_objects.touch(home_collection_path)

@unittest.skipIf(progressbar is None, "progressbar is not installed")
def test_pbar_for_parallel_io_4(self):
def test_progressbar_style_of_pbar_without_registering__issue_574(self):
# As this test demonstrates, we can always just register an update wrapper for an object rather than the object or its update method directly.
# This is good if the progressbar instance is not inherently threadsafe or unable to be referred to by a weak reference.
from irods.manager.data_object_manager import (register_update_instance, _update_fns)

class wrapper:
Expand All @@ -2133,7 +2135,8 @@ def update(self,n):
self.assertEqual(wrapped.pbar.currval, LEN)

@unittest.skipIf(progressbar is None, "progressbar is not installed")
def test_pbar_for_parallel_io_3(self):
def test_progressbar_style_of_pbar_by_registering_type__issue_574(self):
# In this test, registering the instance type allows us to use the progressbar instance in the updatables list
from irods.manager.data_object_manager import (register_update_type, unregister_update_type)

try:
Expand Down Expand Up @@ -2187,7 +2190,7 @@ def _update(n):
unregister_update_type(progressbar_class)

@unittest.skipIf(tqdm is None, "tqdm is not installed")
def test_pbar_for_parallel_io_2(self):
def test_passing_multiple_tqdm_instances_to_be_updated__issue_574(self):
from irods.manager.data_object_manager import (register_update_type, unregister_update_type)

def adapt_tqdm(pbar):
Expand All @@ -2213,6 +2216,7 @@ def _update(n):
unregister_update_type(tqdm.tqdm)

def _run_pbars_for_parallel_io(self, file_content, list_of_progress_bars_and_update_callbacks):
# Helper method for issue #574 tests.
Data = self.sess.data_objects
logical_path = ''
try:
Expand All @@ -2225,7 +2229,7 @@ def _run_pbars_for_parallel_io(self, file_content, list_of_progress_bars_and_upd
if logical_path and Data.exists(logical_path):
Data.unlink(logical_path, force = True)

def test_pbar_for_parallel_io_1(self):
def test_mock_progress_bar_for_parallel_io__issue_574(self):

# Simulated progress bar in the style of TQDM
class mock_progress_bar:
Expand Down

0 comments on commit cdfdc8e

Please sign in to comment.