Coverage for faststream/_internal/constants.py: 93%

15 statements  

« prev     ^ index     » next       coverage.py v7.17.3, created at 2026-11-17 21:20 +0000

1from enum import Enum 

2from typing import Any 

3 

4ContentType = str 

5 

6 

7class ContentTypes(str, Enum): 

8 """A class to represent content types.""" 

9 

10 TEXT = "text/plain" 

11 JSON = "application/json" 

12 

13 

14class EmptyPlaceholder: 

15 __slots__ = () 

16 

17 def __repr__(self) -> str: 

18 return "EMPTY" 

19 

20 def __bool__(self) -> bool: 

21 return False 

22 

23 def __eq__(self, other: object) -> bool: 

24 return isinstance(other, EmptyPlaceholder) 

25 

26 def __hash__(self) -> int: 

27 return hash(EmptyPlaceholder) 

28 

29 

30EMPTY: Any = EmptyPlaceholder() 

31 

32PATH_CONTEXT_PREFIX = "message.path." 

33"""Where a `Path()` parameter reads from: the Path parameters an Address captured."""