Skip to content

Commit 27e1874

Browse files
committed
correct the issue 700 test (access time)
1 parent 19ef753 commit 27e1874

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

irods/test/data_obj_test.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3305,21 +3305,13 @@ def test_access_time__issue_700(self):
33053305
if self.sess.server_version < (5,):
33063306
self.skipTest("iRODS servers < 5.0.0 do not provide an access_time attribute for data objects.")
33073307

3308-
data_path= iRODSPath(self.coll.path,
3309-
unique_name(my_function_name(), datetime.now())
3310-
)
3311-
3312-
time.sleep(2)
3313-
3314-
with self.sess.data_objects.open(data_path,"w") as f:
3315-
f.write(b'_')
3308+
# Create a new, uniquely named test data object.
3309+
data = self.sess.data_objects.create(
3310+
f'{helpers.home_collection(self.sess)}/{unique_name(my_function_name(), datetime.now())}'
3311+
)
33163312

3317-
# At this point, the access_time should be earlier than the modify_time; next we will
3318-
# test that a read() will the update the access timestamp to be equal or greater.
3319-
with self.sess.data_objects.open(data_path,"r") as f:
3320-
f.read()
3321-
data = self.sess.data_objects.get(data_path)
3322-
self.assertGreaterEqual(data.access_time, data.modify_time)
3313+
# Test that access_time is there, and of the right type.
3314+
self.assertIs(type(data.access_time), datetime)
33233315

33243316
if __name__ == "__main__":
33253317
# let the tests find the parent irods lib

0 commit comments

Comments
 (0)