def test_unknownEncoding(self):
        """
        When L{client.ContentDecoderAgent} encounters a decoder it doesn't know
        about, it stops decoding even if another encoding is known afterwards.
        """
        agent = client.ContentDecoderAgent(
            self.agent, [(b'decoder1', Decoder1), (b'decoder2', Decoder2)])
        deferred = agent.request(b'GET', b'http://example.com/foo')

        req, res = self.protocol.requests.pop()

        headers = http_headers.Headers({b'foo': [b'bar'],
                                        b'content-encoding':
                                        [b'decoder1,fizz,decoder2']})
        response = Response((b'HTTP', 1, 1), 200, b'OK', headers, None)
        res.callback(response)

        def check(result):
            self.assertNotIdentical(response, result)
            self.assertIsInstance(result, Decoder2)
            self.assertEqual([b'decoder1,fizz'],
                             result.headers.getRawHeaders(b'content-encoding'))

        return deferred.addCallback(check)

        When L{client.ContentDecoderAgent} encounters a decoder it doesn't know
        about, it stops decoding even if another encoding is known afterwards.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_agent.py