def __catch_login_text(self, response): """ PRIVATE Do not allow an empty login attempt. :raise: SessionError("Login error. Need username and password") """ if response.text == "Login error. Need username and password": raise SessionError(response.text)
def __catch_login_html(self, response): """ PRIVATE Checks the content in the verification is in at least one line of the response. :raise: SessionError when content not in response lines. """ if " <script type=\"text/javascript\" src=\"/js/azkaban/view/login.js\"></script>" in \ response.text.splitlines(): raise SessionError(response.text)
def __catch_response_error_msg(self, exception, response_json): """ PRIVATE Catches the error message when 'error' exists in the response keys. :raise: SessionError, when error_msg equals a 'sessions', or exception(error_msg). """ if u'error' in response_json.keys(): error_msg = response_json[u'error'] if error_msg == "session": raise SessionError(error_msg) raise exception(error_msg)
def __catch_login_text(self, response): if response.text == "Login error. Need username and password": raise SessionError(response.text)
def __catch_response_error_msg(self, exception, response_json): if u'error' in response_json.keys(): error_msg = response_json[u'error'] if error_msg == "session": raise SessionError(error_msg) raise exception(error_msg)
def __catch_login_html(self, response): if " <script type=\"text/javascript\" src=\"/js/azkaban/view/login.js\"></script>" in response.text.splitlines( ): raise SessionError(response.text)