mirror of
https://github.com/p2p-ld/numpydantic.git
synced 2025-01-09 21:44:27 +00:00
make test order insensitive
This commit is contained in:
parent
a64bb2186f
commit
fef528f3bc
1 changed files with 6 additions and 9 deletions
|
@ -64,15 +64,12 @@ def test_schema_tuple():
|
||||||
array: NDArray[Shape["2 x, * y"], (np.uint8, np.uint16)]
|
array: NDArray[Shape["2 x, * y"], (np.uint8, np.uint16)]
|
||||||
|
|
||||||
schema = Model.model_json_schema()
|
schema = Model.model_json_schema()
|
||||||
assert schema["properties"]["array"]["items"] == {
|
assert "anyOf" in schema["properties"]["array"]["items"]["items"]
|
||||||
"items": {
|
conditions = schema["properties"]["array"]["items"]["items"]["anyOf"]
|
||||||
"anyOf": [
|
|
||||||
{"maximum": 255, "minimum": 0, "type": "integer"},
|
assert all([i["type"] == "integer" for i in conditions])
|
||||||
{"maximum": 65535, "minimum": 0, "type": "integer"},
|
assert sorted([i["maximum"] for i in conditions]) == [255, 65535]
|
||||||
]
|
assert all([i["minimum"] == 0 for i in conditions])
|
||||||
},
|
|
||||||
"type": "array",
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def test_schema_number():
|
def test_schema_number():
|
||||||
|
|
Loading…
Reference in a new issue