Skip to content

Commit

Permalink
Handle more cases in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulVanSchayck committed Nov 15, 2024
1 parent ec4cbba commit dd67e0b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion example.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
t=ValuesAxis[AwareDatetime](values=[datetime.now(tz=timezone.utc)]),
),
),
ranges={"temperature": NdArrayFloat(axisNames=["x", "y", "t"], shape=[1, 1, 1], values=[42.0])},
ranges={"temperature": NdArrayFloat(axisNames=["x", "y", "t"], shape=[1, 1, 1], values=["42.0"])},
)

print(c.model_dump_json(exclude_none=True, indent=4))
2 changes: 2 additions & 0 deletions tests/test_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def test_happy_cases(file_name, object_type):
("mixed-type-axes.json", Axes, r"Input should be a valid number"),
("mixed-type-axes-2.json", Axes, r"Input should be a valid string"),
("mixed-type-ndarray-1.json", NdArrayFloat, r"Input should be a valid number"),
("mixed-type-ndarray-1.json", NdArrayStr, r"Input should be 'string'"),
("mixed-type-ndarray-2.json", NdArrayFloat, r"Input should be a valid number"),
("mixed-type-ndarray-2.json", NdArrayStr, r"Input should be 'string'"),
("mixed-type-ndarray-3.json", NdArrayInt, r"Input should be a valid integer"),
("mixed-type-ndarray-3.json", NdArrayFloat, r"Input should be 'float'"),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_data/coverage-mixed-type-ndarray.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
],
"values": [
1,
2,
null,
3
]
},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_data/mixed-type-ndarray-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
2
],
"values": [
"abc",
"42.0",
123
]
}

0 comments on commit dd67e0b

Please sign in to comment.