Skip to content

Commit

Permalink
[#450] test for setting/getting comments
Browse files Browse the repository at this point in the history
  • Loading branch information
d-w-moore authored and alanking committed May 16, 2023
1 parent b17f1e7 commit c7fdd23
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions irods/test/data_obj_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1691,6 +1691,21 @@ def replica_number_from_resource_name(data_path, resc):
if dir1: self.sess.resources.get(uniq1).remove()
if dir2: self.sess.resources.get(uniq2).remove()

def test_set_and_access_data_comments__issue_450(self):
comment = unique_name(my_function_name(), datetime.now()) + " issue 450"
ses = self.sess
with self.create_simple_resc() as newResc:
try:
d = ses.data_objects.create('/{0.zone}/home/{0.username}/data_object_for_issue_450_test'.format(ses))
d.replicate(**{kw.DEST_RESC_NAME_KW:newResc})
ses.data_objects.modDataObjMeta({'objPath':d.path, 'rescHier':ses.resources.get(newResc).hierarchy_string},
{'dataComments':comment})
d = ses.data_objects.get(d.path)
repl = [r for r in d.replicas if r.resource_name == newResc][0]
self.assertEqual(repl.comments, comment)
finally:
d.unlink(force = True)

if __name__ == '__main__':
# let the tests find the parent irods lib
sys.path.insert(0, os.path.abspath('../..'))
Expand Down

0 comments on commit c7fdd23

Please sign in to comment.