#NEWLINE# def GetValuesForTestSettingsAndRunAllTests( ) : #NEWLINE# #INDENT# username = '' #NEWLINE# password = '' #NEWLINE# spreadsheet_key = '' #NEWLINE# worksheet_key = '' #NEWLINE# apps_domain = '' #NEWLINE# apps_username = '' #NEWLINE# apps_password = '' #NEWLINE# print ( 'NOTE: Please run these tests only with a test account. The tests may delete or update your data.' ) #NEWLINE# try : #NEWLINE# #INDENT# ( opts , args ) = getopt . getopt ( sys . argv [ 1 : ] , '' , [ 'username=' , 'password=' , 'ss_key=' , 'ws_key=' , 'apps_username=' , 'apps_password=' , 'apps_domain=' ] ) #NEWLINE# for ( o , a ) in opts : #NEWLINE# #INDENT# if ( o == '--username' ) : #NEWLINE# #INDENT# username = a #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( o == '--password' ) : #NEWLINE# #INDENT# password = a #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( o == '--ss_key' ) : #NEWLINE# #INDENT# spreadsheet_key = a #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( o == '--ws_key' ) : #NEWLINE# #INDENT# worksheet_key = a #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( o == '--apps_username' ) : #NEWLINE# #INDENT# apps_username = a #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( o == '--apps_password' ) : #NEWLINE# #INDENT# apps_password = a #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( o == '--apps_domain' ) : #NEWLINE# #INDENT# apps_domain = a #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# except getopt . GetoptError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# if ( ( username == '' ) and ( password == '' ) ) : #NEWLINE# #INDENT# print ( 'Missing --user and --pw command line arguments, prompting for credentials.' ) #NEWLINE# #UNINDENT# if ( username == '' ) : #NEWLINE# #INDENT# username = raw_input ( 'Please enter your username: ' ) #NEWLINE# #UNINDENT# if ( password == '' ) : #NEWLINE# #INDENT# password = getpass . getpass ( ) #NEWLINE# #UNINDENT# if ( spreadsheet_key == '' ) : #NEWLINE# #INDENT# spreadsheet_key = raw_input ( 'Please enter the key for the test spreadsheet: ' ) #NEWLINE# #UNINDENT# if ( worksheet_key == '' ) : #NEWLINE# #INDENT# worksheet_key = raw_input ( 'Please enter the id for the worksheet to be edited: ' ) #NEWLINE# #UNINDENT# if ( apps_username == '' ) : #NEWLINE# #INDENT# apps_username = raw_input ( 'Please enter your Google Apps admin username: ' ) #NEWLINE# #UNINDENT# if ( spreadsheet_key == '' ) : #NEWLINE# #INDENT# apps_password = getpass . getpass ( ) #NEWLINE# #UNINDENT# if ( apps_domain == '' ) : #NEWLINE# #INDENT# apps_domain = raw_input ( 'Please enter your Google Apps domain: ' ) #NEWLINE# #UNINDENT# RunAllTests ( username , password , spreadsheet_key , worksheet_key , apps_username , apps_password , apps_domain )