def test_can_get_handlers_with_blacklist(self): ctx = self.get_context() ctx.config.UPLOAD_ENABLED = False ctx.config.USE_BLACKLIST = True app = ThumborServiceApp(ctx) handlers = app.get_handlers() expect(handlers).to_length(3)
def test_can_get_handlers_with_blacklist(self): ctx = mock.Mock(config=mock.Mock( UPLOAD_ENABLED=False, USE_BLACKLIST=True, )) app = ThumborServiceApp(ctx) handlers = app.get_handlers() expect(handlers).to_length(3)
def test_can_get_handlers_with_blacklist(self): ctx = mock.Mock( config=mock.Mock( UPLOAD_ENABLED=False, USE_BLACKLIST=True, ) ) app = ThumborServiceApp(ctx) handlers = app.get_handlers() expect(handlers).to_length(3)
def test_can_get_handlers(self): ctx = self.get_context() ctx.config.UPLOAD_ENABLED = False ctx.config.USE_BLACKLIST = False ctx.config.HEALTHCHECK_ROUTE = "/health" app = ThumborServiceApp(ctx) handlers = app.get_handlers() expect(handlers).to_length(2) expect(handlers[0][0]).to_equal(r"/health") expect(handlers[1][0]).to_equal(Url.regex())
def get_handlers(self): handlers = ThumborServiceApp.get_handlers(self) # Remove the default image handler handlers.pop() # Then install our own image handler handlers.append((Url.regex(), RewriteHandler, { 'context': self.context })) return handlers
def test_can_get_handlers(self): ctx = mock.Mock(config=mock.Mock( UPLOAD_ENABLED=False, USE_BLACKLIST=False, )) app = ThumborServiceApp(ctx) handlers = app.get_handlers() expect(handlers).to_length(2) expect(handlers[0][0]).to_equal(r'/healthcheck') expect(handlers[1][0]).to_equal(Url.regex())
def test_can_get_handlers(self): ctx = mock.Mock( config=mock.Mock( UPLOAD_ENABLED=False, USE_BLACKLIST=False, ) ) app = ThumborServiceApp(ctx) handlers = app.get_handlers() expect(handlers).to_length(2) expect(handlers[0][0]).to_equal(r'/healthcheck') expect(handlers[1][0]).to_equal(Url.regex())