uber/cassette — pull request #15 by blampe (2014-06-25 18:41:16+00:00)
Title: handle absent headers with httplib and automatically spin up the test server

The expected behavior for httplib's `getheader` method with a non-existent header is to return None:

```python
In [1]: import httplib

In [2]: c = httplib.HTTPConnection('www.internic.net')

In [3]: c.request('GET', '/domain/named.root')

In [4]: r = c.getresponse()

In [5]: r.getheader('content-length')
Out[5]: '3166'

In [6]: r.getheader('foobar')

In [7]:
```

However cassette will crash if it doesn't have this header. I encountered this when trying to mock some S3 requests:

```
File "/home/uber/api/env/local/lib/python2.7/site-packages/boto/connection.py", line 966, in make_request
retry_handler=retry_handler)
File "/home/uber/api/env/local/lib/python2.7/site-packages/boto/connection.py", line 865, in _mexe
location = response.getheader('location')
File "/home/uber/api/env/local/lib/python2.7/site-packages/cassette/http_response.py", line 58, in getheader
return self.headers[name]
KeyError: 'location'
```

This fixes the library to return None in these cases.

I also tried to simplify the testing process to not require manually spinning up a test server.