File tree Expand file tree Collapse file tree 2 files changed +8
-15
lines changed Expand file tree Collapse file tree 2 files changed +8
-15
lines changed Original file line number Diff line number Diff line change 55from typing import TypeVar
66
77from pydantic import BaseModel
8- from pydantic ._internal ._fields import PydanticGeneralMetadata
9- from pydantic .fields import FieldInfo
108
119from ..version import __gh_version__
1210
13-
14- def is_constrained_str (model_field : FieldInfo ) -> bool :
15- """
16- returns True if the given model_field is a constrained string
17- """
18- for metad in model_field .metadata :
19- if isinstance (metad , PydanticGeneralMetadata ):
20- if hasattr (metad , "pattern" ):
21- return True
22- return False
23- # return isinstance(model_field.outer_type_, type) and issubclass(model_field.outer_type_, str)
24-
25-
2611T = TypeVar ("T" , bound = BaseModel )
2712
2813
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