Skip to content

Commit e0027ca

Browse files
committed
Merge branch 'dev'
2 parents ccede08 + 8f884ba commit e0027ca

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/test_protocol.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,33 @@ def test_array_boolean(self) -> None:
8585
}
8686
with self.assertRaises(jsonschema.exceptions.ValidationError):
8787
validate(target, SUPPORT_SCHEMA)
88+
89+
def test_array_enum(self) -> None:
90+
target = {
91+
"$schema": "http://json-schema.org/draft-07/schema#",
92+
"type": "object",
93+
"properties": {
94+
"a": {
95+
"type": "array",
96+
"items": {
97+
"type": "number",
98+
"enum": [1.1, 2.2, 4.0]
99+
}
100+
},
101+
"b": {
102+
"type": "array",
103+
"items": {
104+
"type": "string",
105+
"enum": ["1.1", "2.2", "4.0"]
106+
}
107+
},
108+
"c": {
109+
"type": "array",
110+
"items": {
111+
"type": "integer",
112+
"enum": [1, 2, 4]
113+
}
114+
}
115+
}
116+
}
117+
assert validate(target, SUPPORT_SCHEMA) is None

0 commit comments

Comments
 (0)