'If there are existing I{Accept-Encoding} fields,
L{client.ContentDecoderAgent} creates a new field for the decoders it
knows about.'

def test_existingHeaders(self):

    headers = http_headers.Headers({'foo': ['bar'], 'accept-encoding': ['fizz']})
    agent = client.ContentDecoderAgent(self.agent, [('decoder1', Decoder1), ('decoder2', Decoder2)])
    agent.request('GET', 'http://example.com/foo', headers=headers)
    protocol = self.protocol
    self.assertEqual(len(protocol.requests), 1)
    (req, res) = protocol.requests.pop()
    self.assertEqual(list(sorted(req.headers.getAllRawHeaders())), [('Accept-Encoding', ['fizz', 'decoder1,decoder2']), ('Foo', ['bar']), ('Host', ['example.com'])])
