'Ensure that 406 enrollment requests are propagated immediately.
Enrollment responses (406) are sent by the server when the client is not
suitable enrolled. The http manager should treat those as correct responses
and stop searching for proxy/url combinations in order to allow the client
to commence enrollment workflow.'

def test406Errors(self):

    instrumentor = RequestsInstrumentor()
    instrumentor.responses = [_make_http_response(code=406)]
    manager = MockHTTPManager()
    with instrumentor.instrument():
        result = manager.OpenServerEndpoint('control')
    self.assertEqual(result.code, 406)
    self.assertEqual(len(instrumentor.actions), 1)
    self.assertEqual(manager.consecutive_connection_errors, 0)
