Skip to content

Commit 051a897

Browse files
committed
format
Change-Id: I9619654247f0f7230c8ba4c76035ad0ff9324fd4
1 parent bfca8b7 commit 051a897

File tree

1 file changed

+24
-19
lines changed

1 file changed

+24
-19
lines changed

tests/test_content.py

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@ class ADataClassWithNullable:
6565
class ADataClassWithList:
6666
a: list[int]
6767

68+
6869
class Choices(enum.Enum):
69-
A:str = "A"
70-
B:str = "B"
71-
C:str = "C"
72-
D:str = "D"
70+
A: str = "A"
71+
B: str = "B"
72+
C: str = "C"
73+
D: str = "D"
7374

7475

7576
@dataclasses.dataclass
7677
class HasEnum:
77-
choice:Choices
78-
78+
choice: Choices
7979

8080

8181
class UnitTests(parameterized.TestCase):
@@ -549,20 +549,25 @@ def b():
549549
},
550550
),
551551
],
552-
['enum', Choices, protos.Schema(type=protos.Type.STRING, enum=['A', 'B', 'C', 'D'])],
553-
['enum_list',
554-
list[Choices],
555-
protos.Schema(
556-
type="ARRAY",
557-
items=protos.Schema(type=protos.Type.STRING, enum=['A', 'B', 'C', 'D']),
558-
),
552+
["enum", Choices, protos.Schema(type=protos.Type.STRING, enum=["A", "B", "C", "D"])],
553+
[
554+
"enum_list",
555+
list[Choices],
556+
protos.Schema(
557+
type="ARRAY",
558+
items=protos.Schema(type=protos.Type.STRING, enum=["A", "B", "C", "D"]),
559+
),
560+
],
561+
[
562+
"has_enum",
563+
HasEnum,
564+
protos.Schema(
565+
type=protos.Type.OBJECT,
566+
properties={
567+
"choice": protos.Schema(type=protos.Type.STRING, enum=["A", "B", "C", "D"])
568+
},
569+
),
559570
],
560-
['has_enum',
561-
HasEnum,
562-
protos.Schema(
563-
type=protos.Type.OBJECT,
564-
properties={'choice': protos.Schema(type=protos.Type.STRING, enum=['A', 'B', 'C', 'D'])})
565-
]
566571
)
567572
def test_auto_schema(self, annotation, expected):
568573
def fun(a: annotation):

0 commit comments

Comments
 (0)