'When L{client.ContentDecoderAgent} encounters a decoder it doesn\'t know
about, it stops decoding even if another encoding is known afterwards.'

def test_unknownEncoding(self):

    agent = client.ContentDecoderAgent(self.agent, [('decoder1', Decoder1), ('decoder2', Decoder2)])
    deferred = agent.request('GET', 'http://example.com/foo')
    (req, res) = self.protocol.requests.pop()
    headers = http_headers.Headers({'foo': ['bar'], 'content-encoding': ['decoder1,fizz,decoder2']})
    response = Response(('HTTP', 1, 1), 200, 'OK', headers, None)
    res.callback(response)
    def check(result):
        self.assertNotIdentical(response, result)
        self.assertIsInstance(result, Decoder2)
        self.assertEqual(['decoder1,fizz'], result.headers.getRawHeaders('content-encoding'))
    return deferred.addCallback(check)
