Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

Commit

Permalink
tests passing on Python 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
kilink committed Nov 19, 2013
1 parent d584797 commit b5cbd07
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions bobodoctestumentation/src/bobodoctestumentation/decorator.test
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ We use resources by calling the result of calling bobo_response:
... request, request.path_info, request.method)
... if found is not None:
... print_response(found)
... except (bobo.MissingFormVariable, bobo.MethodNotAllowed) as exc:
... print("Raised %s: %s" % (exc.__class__.__name__, exc,))
... except bobo.BoboException as v:
... print(v.__class__.__name__+':')
... pprint.pprint(v.__dict__, width=1)
Expand Down Expand Up @@ -241,9 +243,7 @@ order.
Here, we matched the second caller and passed the name.

>>> call_resource(hi, '/foo', method='HEAD')
Traceback (most recent call last):
...
bobo.MethodNotAllowed: Allowed: 'GET'
Raised MethodNotAllowed: Allowed: 'GET'

This time, we matched the first resource, but the method was invalid,
so a MethodNotAllowed exception was raised.
Expand Down Expand Up @@ -369,9 +369,7 @@ The query decorators will also use form data:
If parameters are ommitted, we'll get a MissingFormVariable error:

>>> call_resource(foo, '/a/b')
Traceback (most recent call last):
...
bobo.MissingFormVariable: y
Raised MissingFormVariable: y

The post decorator will *only* use form data:

Expand All @@ -394,9 +392,7 @@ The post decorator will *only* use form data:
'status': 200}

>>> call_resource(foo, '/a/b', 'z=1')
Traceback (most recent call last):
...
bobo.MissingFormVariable: y
Raised MissingFormVariable: y

Resources as methods
--------------------
Expand Down Expand Up @@ -594,9 +590,7 @@ Scanning classes with duplicate routes
'status': 200}

>>> call_resource(C, '/pre', method='HEAD')
Traceback (most recent call last):
...
bobo.MethodNotAllowed: Allowed: 'GET', 'POST'
Raised MethodNotAllowed: Allowed: 'GET', 'POST'

>>> call_resource(C, '/pre/a')
BoboException:
Expand All @@ -613,9 +607,7 @@ Scanning classes with duplicate routes
'status': 200}

>>> call_resource(C, '/pre/a', method='HEAD')
Traceback (most recent call last):
...
bobo.MethodNotAllowed: Allowed: 'GET', 'POST'
Raised MethodNotAllowed: Allowed: 'GET', 'POST'

subroutes don't screw up other uses of a class
----------------------------------------------
Expand Down

0 comments on commit b5cbd07

Please sign in to comment.