Are there ways to test my error_handlers setup in the app.yaml file, especially the error code over_quota?
Are there ways to test my error_handlers setup in the app.yaml file, especially the
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Testing
error_handlersdev_appserver.pyis the application that is parsing yourapp.yamland serving these error files. This means that you’re best bet is probably a straight up acceptance test where you bring updev_appserver.pyand try hitting itlocalhost:8080withGETsandPUTsthat would trigger the various errors you’re expecting.So, if
/fooreturns a 404, you could do the following with Python requests:Testing Over Quota Error
In this specific case it sounds like you’re trying to explicitly raise the
over_quotaerror. This link mentions that the exception you’re looking for isapiproxy_errors.OverQuotaError.I’m not sure what your test code is, but have you tried explicitly raising this error, with straight up
raise?I was able to run the following code after bootstrapping my
apiproxy_stub_map, setting up my path, etc.: