File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44from typing import TypeVar
55
66from pydantic import BaseModel
7- from pydantic ._internal ._fields import PydanticGeneralMetadata
8- from pydantic .fields import FieldInfo
97
108from ..version import __gh_version__
119
12-
13- def is_constrained_str (model_field : FieldInfo ) -> bool :
14- """
15- returns True if the given model_field is a constrained string
16- """
17- for metad in model_field .metadata :
18- if isinstance (metad , PydanticGeneralMetadata ):
19- if hasattr (metad , "pattern" ):
20- return True
21- return False
22- # return isinstance(model_field.outer_type_, type) and issubclass(model_field.outer_type_, str)
23-
24-
2510T = TypeVar ("T" , bound = BaseModel )
2611
2712
Original file line number Diff line number Diff line change 1+ class TestImport :
2+ def test_importing_an_enum (self ) -> None :
3+ """
4+ checks that importing an enum works
5+ """
6+ from bo4e import Vertragsstatus # pylint: disable=import-outside-toplevel,unused-import
7+
8+ assert True
You can’t perform that action at this time.
0 commit comments