File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77import tempfile
88import shutil
99from subprocess import check_output , CalledProcessError
10+ from irods import client_init
1011from irods import MAX_PASSWORD_LENGTH
1112from irods .exception import GroupDoesNotExist , UserDoesNotExist
1213from irods .meta import iRODSMetaCollection , iRODSMeta
@@ -604,6 +605,19 @@ def test_set_and_query_user_quota(self):
604605 if bob :
605606 ses .users .remove (bob .name )
606607
608+ def test_we_cannot_overwrite_irodsA_without_overwrite_option_true__issue_635 (self ):
609+ # Assert the auth_file exists and store the contents for later reference.
610+ auth_file = os .path .expanduser ('~/.irods/.irodsA' )
611+ self .assertTrue (os .path .isfile (auth_file ))
612+ with open (auth_file ,'rb' ) as f :
613+ auth_file_contents = f .read ()
614+
615+ with self .assertRaises (client_init .irodsA_already_exists ):
616+ client_init .write_native_credentials_to_secrets_file ('somevalue' ,overwrite = False )
617+
618+ # Assert the auth file's contents haven't changed.
619+ with open (auth_file ,'rb' ) as f :
620+ self .assertEqual (auth_file_contents , f .read ())
607621
608622if __name__ == '__main__' :
609623 # let the tests find the parent irods lib
You can’t perform that action at this time.
0 commit comments