|
1 | 1 | #! /usr/bin/env python |
2 | 2 |
|
3 | | -from datetime import datetime, timezone |
| 3 | +from datetime import datetime, timezone, timedelta |
4 | 4 | import base64 |
5 | 5 | import collections |
6 | 6 | import concurrent.futures |
@@ -3305,16 +3305,13 @@ def test_access_time__issue_700(self): |
3305 | 3305 | if self.sess.server_version < (5,): |
3306 | 3306 | self.skipTest("iRODS servers < 5.0.0 do not provide an access_time attribute for data objects.") |
3307 | 3307 |
|
3308 | | - data_path= iRODSPath(self.coll.path, |
3309 | | - unique_name(my_function_name(), datetime.now()) |
3310 | | - ) |
3311 | | - with self.sess.data_objects.open(data_path,"w") as f: |
3312 | | - f.write(b'_') |
3313 | | - with self.sess.data_objects.open(data_path,"r") as f: |
3314 | | - f.read() |
| 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 | + ) |
3315 | 3312 |
|
3316 | | - data = self.sess.data_objects.get(data_path) |
3317 | | - 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) |
3318 | 3315 |
|
3319 | 3316 | if __name__ == "__main__": |
3320 | 3317 | # let the tests find the parent irods lib |
|
0 commit comments