mozilla-services/cornice — pull request #134 by amotl (2013-03-29 22:18:27+00:00)
Title: fix and tests for "header" validation using CorniceSchema

Validating a request header using a colander schema by defining a schema node with `location="header"` had problems. Bug is fixed and proper tests should assure it won't break in the future.

The fix is based on the assumption that Cornice should get consistent in naming the value of the location actually `header` instead of `headers`, which is reflected at ...
https://github.com/mozilla-services/cornice/blob/master/cornice/schemas.py#L108

... and in various other places, e.g.:

> location is the location of the error. It can be “querystring”, “header” or “body”
-- http://cornice.readthedocs.org/en/latest/validation.html#dealing-with-errors

... and:
https://github.com/mozilla-services/cornice/blob/master/cornice/tests/test_pyramidhook.py#L47