File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
33243316if __name__ == "__main__" :
33253317 # let the tests find the parent irods lib
You can’t perform that action at this time.
0 commit comments