Skip to content

Commit c7fdd23

Browse files
d-w-moorealanking
authored andcommitted
[#450] test for setting/getting comments
1 parent b17f1e7 commit c7fdd23

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

irods/test/data_obj_test.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,6 +1691,21 @@ def replica_number_from_resource_name(data_path, resc):
16911691
if dir1: self.sess.resources.get(uniq1).remove()
16921692
if dir2: self.sess.resources.get(uniq2).remove()
16931693

1694+
def test_set_and_access_data_comments__issue_450(self):
1695+
comment = unique_name(my_function_name(), datetime.now()) + " issue 450"
1696+
ses = self.sess
1697+
with self.create_simple_resc() as newResc:
1698+
try:
1699+
d = ses.data_objects.create('/{0.zone}/home/{0.username}/data_object_for_issue_450_test'.format(ses))
1700+
d.replicate(**{kw.DEST_RESC_NAME_KW:newResc})
1701+
ses.data_objects.modDataObjMeta({'objPath':d.path, 'rescHier':ses.resources.get(newResc).hierarchy_string},
1702+
{'dataComments':comment})
1703+
d = ses.data_objects.get(d.path)
1704+
repl = [r for r in d.replicas if r.resource_name == newResc][0]
1705+
self.assertEqual(repl.comments, comment)
1706+
finally:
1707+
d.unlink(force = True)
1708+
16941709
if __name__ == '__main__':
16951710
# let the tests find the parent irods lib
16961711
sys.path.insert(0, os.path.abspath('../..'))

0 commit comments

Comments
 (0)