def test_login_basic(): clear_test_credentials() assert config.config_file_read_api_key('test') is None prepare_successful_login() ArcsecondAPI.login(TEST_LOGIN_USERNAME, TEST_LOGIN_PASSWORD, debug=True, test=True) assert config.config_file_read_api_key('test') is None assert config.config_file_read_upload_key('test') is None
def test_login_valid_parameters_without_confirmation(): config.config_file_clear_api_key('test') assert config.config_file_read_api_key('test') is None runner = CliRunner(echo_stdin=True) prepare_successful_login() result = runner.invoke(cli.login, ['--debug', '--test'], input=TEST_LOGIN_USERNAME + '\n' + TEST_LOGIN_PASSWORD + '\nN') assert result.exit_code == 0 and not result.exception assert config.config_file_read_api_key('test') is None
def test_login_both_apikey_uploadkey(): clear_test_credentials() assert config.config_file_read_api_key('test') is None prepare_successful_login() ArcsecondAPI.login(TEST_LOGIN_USERNAME, TEST_LOGIN_PASSWORD, api_key=True, upload_key=True, debug=True, test=True) assert config.config_file_read_api_key('test') == TEST_API_KEY assert config.config_file_read_upload_key('test') == TEST_UPLOAD_KEY