def init(): """Makes an instance of the api and attempts to login with it. Returns the authenticated api. """ api = Api() logged_in = False attempts = 0 while not logged_in and attempts < 3: email = raw_input("Email: ") password = getpass() logged_in = api.login(email, password) attempts += 1 return api
def init(): """Makes an instance of the api and attempts to login with it. Returns the authenticated api. """ api = Api() logged_in = False attempts = 0 print "Warning: this test suite _might_ modify the library it is run on." while not logged_in and attempts < 3: email = raw_input("Email: ") password = getpass() logged_in = api.login(email, password) attempts += 1 return api