'Verify that each of two different attributes which are associated with
the same state properly reflect changes made through the other.
This is used to test that the C{headers}/C{responseHeaders} and
C{received_headers}/C{requestHeaders} pairs interact properly.'

def _compatHeadersTest(self, oldName, newName):

    req = http.Request(DummyChannel(), False)
    getattr(req, newName).setRawHeaders('test', ['lemur'])
    self.assertEqual(getattr(req, oldName)['test'], 'lemur')
    setattr(req, oldName, {'foo': 'bar'})
    self.assertEqual(list(getattr(req, newName).getAllRawHeaders()), [('Foo', ['bar'])])
    setattr(req, newName, http_headers.Headers())
    self.assertEqual(getattr(req, oldName), {})
