diff --git a/packaging/irods_prc_tests/test_rule_engine_plugin_metadata_guard_atomic.py b/packaging/irods_prc_tests/test_rule_engine_plugin_metadata_guard_atomic.py index 51283d0..d7c7631 100644 --- a/packaging/irods_prc_tests/test_rule_engine_plugin_metadata_guard_atomic.py +++ b/packaging/irods_prc_tests/test_rule_engine_plugin_metadata_guard_atomic.py @@ -107,7 +107,7 @@ def test_guard_atomic_operations_admin_only__issue_38(self): def test_guard_atomic_operations_editor_list__issue_38(self): # set metadata_guard config AVU on collection to admin_only: false and irods:: as protected prefix - # also, add test user as editor + # also, add alice user as editor with iRODSSession(host='localhost', port=1247, user='rods', password='rods', zone='tempZone') as local_admin: coll = local_admin.collections.get("/tempZone") METADATA_GUARD_CONFIG = { @@ -124,7 +124,7 @@ def test_guard_atomic_operations_editor_list__issue_38(self): obj.metadata.apply_atomic_operations( AVUOperation(operation='add', avu=iRODSMeta('irods::editorlist', 'editorlist'))) self.assertEqual(obj.metadata['irods::editorlist'], iRODSMeta('irods::editorlist', 'editorlist')) - # remove test user from editor list + # remove alice user from editor list with iRODSSession(host='localhost', port=1247, user='rods', password='rods', zone='tempZone') as local_admin: coll = local_admin.collections.get("/tempZone") METADATA_GUARD_CONFIG = { @@ -137,7 +137,9 @@ def test_guard_atomic_operations_editor_list__issue_38(self): with iRODSSession(host='localhost', port=1247, user='alice', password='test', zone='tempZone') as unprivileged_user: obj = unprivileged_user.data_objects.get(self.TEST_DATA_OBJECT_PATH) - # operation should succeed, as alice is set as an editor + # this was set previously, make sure it is still the case + self.assertEqual(obj.metadata['irods::editorlist'], iRODSMeta('irods::editorlist', 'editorlist')) + # operation should fail, as test user is no longer in editor list self.assertRaises(irods.exception.CAT_INSUFFICIENT_PRIVILEGE_LEVEL, lambda: obj.metadata.apply_atomic_operations( AVUOperation(operation='remove', avu=iRODSMeta('irods::editorlist', 'editorlist'))))