Ejemplo n.º 1
0
def test_log_routes(logger_mock):
    action_object = MockAction()
    app = Pantam()
    app.actions = [
        {
            "file_name":
            "index.py",
            "module_name":
            "index",
            "action_class":
            MockAction,
            "action_obj":
            action_object,
            "routes": [
                {
                    "method": "fetchAll",
                    "verb": "get",
                    "url": "/",
                },
                {
                    "method": "fetchSingle",
                    "verb": "get",
                    "url": "/:id",
                },
            ],
        },
    ]
    app.log_routes()
    logger_mock.assert_called_with("""Available Routes:

GET    -> /    -> index.py -> fetchAll
GET    -> /:id -> index.py -> fetchSingle
GET    -> /healthz [health check endpoint]""")
Ejemplo n.º 2
0
def test_get_action_routes():
    app = Pantam()
    app.actions = "test"
    assert app.get_actions() == "test"