Coverage for postrfp/shared/constants.py: 100%
13 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 re
2from enum import Enum
3from typing import Optional, TYPE_CHECKING
5if TYPE_CHECKING:
6 from sqlalchemy.orm import Session
8"""
9TEST_SESSION is a global variable used for transaction hacks in functional tests
10"""
11TEST_SESSION: Optional["Session"] = None
13# Regex to match HTTP method prefixes in function names
14HANDLER_PREFIX = re.compile(r"^(get|post|put|delete)_")
17class MimeTypes(str, Enum):
18 ANY = "application/octet-stream"
19 DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
20 XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
23MIME_TYPE_VALUES = [m.value for m in MimeTypes]
25API_VERSION_FILEPATH = "postrfp.web.api_version"
27CEL_EXPRESSION_MAX_LENGTH = 4096