def test_handle_smart_errors(self):
        api = restplus.Api(self.app)
        view = restplus.Resource

        api.add_resource(view, '/foo', endpoint='bor')
        api.add_resource(view, '/fee', endpoint='bir')
        api.add_resource(view, '/fii', endpoint='ber')

        with self.app.test_request_context("/faaaaa"):
            resp = api.handle_error(NotFound())
            self.assertEqual(resp.status_code, 404)
            self.assertEqual(resp.data.decode(), dumps({
                "message": NotFound.description,
            }) + "\n")

        with self.app.test_request_context("/fOo"):
            resp = api.handle_error(NotFound())
            self.assertEqual(resp.status_code, 404)
            self.assertTrue('did you mean /foo ?' in resp.data.decode())

        self.app.config['ERROR_404_HELP'] = False

        with self.app.test_request_context("/fOo"):
            resp = api.handle_error(NotFound())
            self.assertEqual(resp.status_code, 404)
            self.assertEqual(resp.data.decode(), dumps({
                "message": NotFound.description
            }) + "\n")
dataset/ETHPy150Open noirbizarre/flask-restplus/tests/legacy/test_api.py/APITestCase.test_handle_smart_errors/original