Skip to content

Commit dc1df33

Browse files
committed
fix access time test
1 parent e4369c5 commit dc1df33

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

irods/test/data_obj_test.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3308,17 +3308,18 @@ def test_access_time__issue_700(self):
33083308
data_path= iRODSPath(self.coll.path,
33093309
unique_name(my_function_name(), datetime.now())
33103310
)
3311+
3312+
time.sleep(2)
3313+
33113314
with self.sess.data_objects.open(data_path,"w") as f:
33123315
f.write(b'_')
3316+
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.
33133319
with self.sess.data_objects.open(data_path,"r") as f:
33143320
f.read()
3315-
33163321
data = self.sess.data_objects.get(data_path)
3317-
3318-
# The difference between the two timestamps should be positive but less than a second.
3319-
time_difference = data.access_time - data.modify_time
3320-
self.assertGreaterEqual(time_difference, timedelta(seconds=0))
3321-
self.assertLessEqual(time_difference, timedelta(seconds=1))
3322+
self.assertGreaterEqual(data.access_time, data.modify_time)
33223323

33233324
if __name__ == "__main__":
33243325
# let the tests find the parent irods lib

0 commit comments

Comments
 (0)