Skip to content

Commit

Permalink
make test order insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
sneakers-the-rat committed Jul 31, 2024
1 parent a64bb21 commit fef528f
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions tests/test_ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,12 @@ class Model(BaseModel):
array: NDArray[Shape["2 x, * y"], (np.uint8, np.uint16)]

schema = Model.model_json_schema()
assert schema["properties"]["array"]["items"] == {
"items": {
"anyOf": [
{"maximum": 255, "minimum": 0, "type": "integer"},
{"maximum": 65535, "minimum": 0, "type": "integer"},
]
},
"type": "array",
}
assert "anyOf" in schema["properties"]["array"]["items"]["items"]
conditions = schema["properties"]["array"]["items"]["items"]["anyOf"]

assert all([i["type"] == "integer" for i in conditions])
assert sorted([i["maximum"] for i in conditions]) == [255, 65535]
assert all([i["minimum"] == 0 for i in conditions])


def test_schema_number():
Expand Down

0 comments on commit fef528f

Please sign in to comment.