summaryrefslogtreecommitdiff
path: root/pecan/tests/test_base.py
Commit message (Collapse)AuthorAgeFilesLines
* Allowing tracebacks to be surfaced through abortJohn Vrbanac2015-06-031-0/+15
| | | | | | | | | | | | | | Currently, anytime abort(...) is called, It raises a new exception which then suppresses any existing tracebacks. This causes error monitoring systems like NewRelic to report back worthless surface-level tracebacks that have nothing to do with the application. This change allows for the exception type to change, but keep the existing traceback (if one exists). This allows for monitoring systems to see a real traceback that can be correlated to logged information. Change-Id: Ibe6eb37e25b74d1dcfca76dfc1f5bbce28d34e85
* Allow users to specify custom path segments for routing.Ryan Petrello2015-05-211-1/+262
| | | | Change-Id: I3f998d62c2f188818a747f1aa91beb9439ed77a2
* Fix unquoting of positional args with plus signMaxim Kulkin2015-05-121-0/+20
| | | | | | Closes-Bug: #1425750 Change-Id: I60616299b7853b0587ff25b74bfc155dc7589204
* Properly handle Python3 Unicode path segments in pecan routing.Ryan Petrello2015-05-071-0/+31
| | | | | Change-Id: I3890d73a087f7635ddc51b71d3d6f68a41058c42 Closes-Bug: 1451842
* make_app() now uses the debugger param in DebugMiddleware()Joe D'Andrea2015-04-291-0/+36
| | | | | | | | Setting app.debugger in setup.py now takes proper effect. A warning is issued if the entry point is not callable. Change-Id: I58a860b8ef0e1cb956b4554071275c024a1949d2 Closes-Bug: #1449573
* core: do not assume controller is a methodJulien Danjou2015-03-021-0/+10
| | | | | | | | If a controller is not a method (e.g. a staticmethod or a function), there's no need to pop up the self argument. That actually make the signature to mismatch, so let's fix that. Change-Id: Ia96b7d19b2b664381e422b7182d0437b841914dd
* Fix broken wsme-stable job and pep8 failures.Julien Danjou2015-03-021-4/+5
| | | | Change-Id: I4ff0a7a7926f7a645fa8d59242be9d31bd683106
* Change pecan to more gracefully handle a few odd request encoding edge cases.Ryan Petrello2015-01-081-0/+17
| | | | | | | | | | | | | | | | | | Webob raises UnicodeDecodeErrors during request argument parsing in two situations: * HTTP POST requests composed of non-Unicode data (only affects Webob in Python2) * URL paths that contain invalid percent-encoded characters, e.g., /some/path/%AA Pecan should detect these types of decoding failures when `webob.Request` attributes are accessed, log the original exception, and coerce the HTTP 500 into a more accurate HTTP 400. Fixes bug: 1408102 Fixes bug: 1407749 Change-Id: I734efd36230b6742805bcfd801dc0de2489ef92b
* Allows multiple parameters to be converted to listMehdi Abaakouk2014-12-111-0/+28
| | | | | | | | | | Webob passed duplicates parameters to pecan, but pecan take only the first one. This patch changes than and pass the duplicated parameters as list to controller method. Closes bug: #1401123 Change-Id: I8d0a7eda30a4c03cd85ed730ac3f08dde5e9aa56
* Only define remainder when not emptyChmouel Boudjnah2014-10-281-0/+5
| | | | | | | | I had an issue using a post method on a /path/ since get_args will set me up with a first empty argument of an empty string and eat my first argument with it. Change-Id: Ieb2f192127c1fca430f1376e5bdb2be863fe6920
* For HTTP POSTs, map JSON request bodies to controller keyword arguments.Ryan Petrello2014-09-251-0/+98
| | | | | Fixes-bug: 1336943 Change-Id: I2e59e5d43d87a5279c41b155188ebe3281de0e11
* When detecting non-content for HTTP 204, properly catch UnicodeDecodeError.Ryan Petrello2014-09-231-0/+8
| | | | | Fixes-bug: 1373003 Change-Id: I7761004c047976195a680bfb2ca23fe92516f3a6
* Don't (mistakenly) set HTTP 204 on controllers which set `response.body_file`.Ryan Petrello2014-07-091-0/+83
| | | | | | Fixes bug 1339121 Change-Id: I70785315837b3907b63bb10565f3ccdf07559e8d
* Merge "Serialize WebOb errors as JSON if the client requests it via an ↵Jenkins2014-06-251-0/+37
|\ | | | | | | Accept header."
| * Serialize WebOb errors as JSON if the client requests it via an Accept header.Ryan Petrello2014-06-251-0/+37
| | | | | | | | | | Change-Id: I32040eff4259daf7a0e58b81ce861758d1d14bd9 Fixes bug 1324134
* | Merge "Add support for specifying custom request and response implementations."Jenkins2014-06-251-2/+37
|\ \ | |/ |/|
| * Add support for specifying custom request and response implementations.Ryan Petrello2014-06-251-2/+37
| | | | | | | | | | | | | | | | I noticed that people using pecan have taken to writing custom webob req/resp subclasses and monkeypatching onto `pecan.request` and `pecan.response`. Let's give them what they need to do this properly. Change-Id: If0ac953e381cec3a744388000a3b3afc0ea2525c
* | Fix a bug that broke `default_renderer = json`.Ryan Petrello2014-06-251-0/+13
|/ | | | | Change-Id: Ie57feadb6efe664c1bc3c39debcb21c3355f210c Fixes bug 1332501
* Add support for Pecan *without* thread local request/response objectsRyan Petrello2014-05-281-1/+25
| | | | Change-Id: I5a5a05e1f57ef2d8ad64e925c7ffa6907b914273
* Allow controllers to return an explicit `webob.Response` object.Ryan Petrello2014-05-191-0/+17
| | | | Change-Id: I5e827eed73962a0a6f5d879224759a4d13888751
* Do not include Content-Type on 204 and 304 status codesJulien Danjou2014-04-241-0/+1
| | | | Change-Id: Iec7e5e0a7d5f10bf264a2e8e0a01cdaf2d73fd86
* Merge "If an exposed method returns nothing, reply with an HTTP 204."Jenkins2014-04-231-2/+2
|\
| * If an exposed method returns nothing, reply with an HTTP 204.Ryan Petrello2014-04-231-2/+2
| | | | | | | | | | Fixes-bug: 1311629 Change-Id: I06259adc76631d88777d1747c09dae3a67692a39
* | pep8 fixesRyan Petrello2014-03-271-2/+2
|/ | | | Change-Id: If592949bb1dedfc3674d939d5244f5efd4a02eb3
* Cleanup the WSGI app reference from the threadlocal state on every request.Ryan Petrello2014-02-131-1/+1
| | | | | Change-Id: I22f93224047e2b6fd6692423cc27f85b6261f9f8 Closes-Bug: #1279461
* Persist `pecan.request.context` across internal redirects.Ryan Petrello2013-09-301-0/+34
| | | | | Fixes-bug: 1233367 Change-Id: Iae7926003cd672b874b62418c53e5af227878151
* core: do not try to set response body to NoneJulien Danjou2013-09-261-0/+17
| | | | | | | In the context of DELETE, it's more than likely than the response will be empty. In such a case, setting response.body to None will fail. Change-Id: I29fde6c448c935c40c768376a15e83337b951898
* Fix a routing bug for certain _lookup controller configurations.Ryan Petrello2013-08-081-0/+29
|
* Resolve a few differences in TypeError messaging in Python 3.3.Ryan Petrello2013-04-301-2/+8
|
* Cleanup and add a ton of bytes() compatability for tests.Ryan Petrello2013-04-301-127/+129
|
* Update cStringIO imports.Ryan Petrello2013-04-301-4/+2
|
* Update exception block syntax.Ryan Petrello2013-04-301-6/+6
|
* Remove some unnecessary cruft and improve test coverage for core.pyRyan Petrello2013-04-251-1/+18
|
* Improve runtime configuration cleanup for tests.Ryan Petrello2013-03-131-20/+21
|
* Fix a pep8 spacing violation.Ryan Petrello2013-02-041-1/+0
|
* add a test to demonstrate the problemAlfredo Deza2013-02-031-0/+17
|
* Option to disable content-type guessing by URLDoug Hellmann2013-01-171-0/+15
| | | | | | | | Add a new option to disable content-type guessing based on the extension of the URL. Change-Id: I5bea41fcc1011cfb19255cc0333924034007a645 Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
* Always include ``pecan.request['extension']``.Ryan Petrello2013-01-081-2/+2
|
* Don't strip a dotted extension from the path unless it has a matching mimetype.Ryan Petrello2013-01-081-2/+20
|
* More refinements for HTTP Accept content type guessing.Ryan Petrello2012-11-041-3/+3
|
* Cleaning up the Accept headers tests.Ryan Petrello2012-11-031-2/+2
|
* Add support for content type detection via Accept headers.Ryan Petrello2012-11-031-0/+48
|
* pep8 complianceRyan Petrello2012-10-291-4/+3
|
* Tests for Pecan logging.Ryan Petrello2012-03-241-0/+62
|
* Simplifying (and documenting) logging.Ryan Petrello2012-03-231-139/+0
|
* Fixing a few bugs in the debug middleware and legacy iPython support.Ryan Petrello2012-03-211-1/+1
|
* More test coverage.Ryan Petrello2012-03-201-15/+14
|
* Organizing various core middlewares into ``pecan.middleware``.Ryan Petrello2012-03-201-1/+1
|
* Silencing warnings and stdout writes in our test suite.Ryan Petrello2012-03-151-9/+19
|
* Fixing a bad assumption in the redirect testing that conflicts with theJonathan LaCour2012-03-151-1/+1
| | | | debug middleware.