'Note the case normalization of header names here, to
.capitalize()-case.  This should be preserved for
backwards-compatibility.  (In the HTTP case, normalization to
.title()-case is done by urllib2 before sending headers to
http.client).
Note that e.g. r.has_header("spam-EggS") is currently False, and
r.get_header("spam-EggS") returns None, but that could be changed in
future.
Method r.remove_header should remove items both from r.headers and
r.unredirected_hdrs dictionaries'

def test_request_headers_methods(self):

    url = 'http://example.com'
    req = Request(url, headers={'Spam-eggs': 'blah'})
    self.assertTrue(req.has_header('Spam-eggs'))
    self.assertEqual(req.header_items(), [('Spam-eggs', 'blah')])
    req.add_header('Foo-Bar', 'baz')
    self.assertEqual(sorted(req.header_items()), [('Foo-bar', 'baz'), ('Spam-eggs', 'blah')])
    self.assertFalse(req.has_header('Not-there'))
    self.assertIsNone(req.get_header('Not-there'))
    self.assertEqual(req.get_header('Not-there', 'default'), 'default')
    req.remove_header('Spam-eggs')
    self.assertFalse(req.has_header('Spam-eggs'))
    req.add_unredirected_header('Unredirected-spam', 'Eggs')
    self.assertTrue(req.has_header('Unredirected-spam'))
    req.remove_header('Unredirected-spam')
    self.assertFalse(req.has_header('Unredirected-spam'))
