So, funny thing about that...

No matter what you input (case wise) for headers, Python's urllib2 will convert it to all lower case except for the first character. So User-Agent becomes User-agent.

I am happy to change the call to add User-Agent, but the test will have to do a lookup on User-agent because thats what it actually is in the request.

>>> import urllib2
>>> req = urllib2.Request('derp')
>>> req.add_header('User-Agent', 'herp')
>>> req.headers
{'User-agent': 'herp'}

Notice User-Agent becomes User-agent.