Coverage for postrfp/web/apps/fsm.py: 100%
19 statements
« prev ^ index » next coverage.py v7.11.0, created at 2025-10-22 21:34 +0000
« prev ^ index » next coverage.py v7.11.0, created at 2025-10-22 21:34 +0000
1import logging
3from webob import Response
5from postrfp.auth.policy import PassthroughPolicy
6from postrfp.web.suxint import Sux
7from postrfp.web.base import WSGIApp
10log = logging.getLogger(__name__)
13fsm_sux = Sux(
14 "postrfp.buyer.fsm_endpoints",
15 "postrfp.web.adaptors.core",
16 models_module="postrfp.fsm.schemas",
17 api_name="PostRFP FSM API",
18)
21class FsmApp(WSGIApp):
22 """
23 Finite State Machine Web Application
24 """
26 routes = {}
28 def __init__(self, **kwargs):
29 if not kwargs.get("auth_policy", None):
30 kwargs["auth_policy"] = PassthroughPolicy()
31 super().__init__(**kwargs)
33 def validate_user(self, request):
34 pass
36 def build_sux(self):
37 self.sux_instance = fsm_sux
40@FsmApp.route("/status")
41def status(request):
42 """
43 Check that the app is running.
45 In auth/webapp so there is no authentication so this endpoint can be called
46 from uptime monitoring tools
47 """
48 return Response(body="ok", content_type="text/plain")