cdent / gabbi

Declarative HTTP Testing for Python and anything else
http://gabbi.readthedocs.org/
Other
148 stars 34 forks source link

defaults handling is case sensitive #213

Closed cdent closed 7 years ago

cdent commented 7 years ago

Given:

defaults:
  request_headers:
      Foo-Bar: value

tests:
- name: some test
   GET: /
   request_headers:
     foo-bar: value

foo-bar will not clobber Foo-Bar.

This may or may not be a bug. I initially thought it was (because I got caught by it) but while writing this I realized there's no good way to make it guess well. There are likely times where case does matter in a default (consider all defaults here, not jus request headers).

If we say it is case sensitive and stick with it then it is explicit and predictable.

/cc @FND

FND commented 7 years ago

As stated on IRC, I agree that gabbi attempting to guess what the correct variant would be can only go wrong. Thus we'll have to rely on authors to be diligent, i.e. gabbi should not normalize case.