From: Michael Tremer Date: Thu, 14 Jul 2022 16:31:47 +0000 (+0000) Subject: hub: Drop test handlers X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0b403186cc68ccac0f2560f43d0558dfebff1bf6;p=pbs.git hub: Drop test handlers Signed-off-by: Michael Tremer --- diff --git a/src/hub/__init__.py b/src/hub/__init__.py index 4bc3a609..6184406f 100644 --- a/src/hub/__init__.py +++ b/src/hub/__init__.py @@ -18,11 +18,6 @@ class Application(tornado.web.Application): # Redirect strayed users. (r"/", tornado.web.RedirectHandler, { "url" : "https://pakfire.ipfire.org/" }), - # Test handlers - (r"/noop", handlers.NoopHandler), - (r"/error/test", handlers.ErrorTestHandler), - (r"/error/test/(\d+)", handlers.ErrorTestHandler), - # Builds (r"/builds", builds.CreateHandler), (r"/builds/(.*)", handlers.BuildsGetHandler), diff --git a/src/hub/handlers.py b/src/hub/handlers.py index 6ffa91f2..82dceb75 100644 --- a/src/hub/handlers.py +++ b/src/hub/handlers.py @@ -109,31 +109,6 @@ class BaseHandler(BackendMixin, HTTPBasicAuthMixin, tornado.web.RequestHandler): return self.backend.uploads.get_by_uuid(uuid) -class NoopHandler(BaseHandler): - def get(self): - if self.builder: - self.write("Welcome to the Pakfire hub, %s!" % self.builder.hostname) - elif self.user: - self.write("Welcome to the Pakfire hub, %s!" % self.user.name) - else: - self.write("Welcome to the Pakfire hub!") - - -class ErrorTestHandler(BaseHandler): - def get(self, error_code=200): - """ - For testing a client. - - This just returns a HTTP response with the given code. - """ - try: - error_code = int(error_code) - except ValueError: - error_code = 200 - - raise tornado.web.HTTPError(error_code) - - # Builds class BuildsGetHandler(BaseHandler):