Browse Source

Add test for coverage for jsonable_encoder

pull/14575/head
Sebastián Ramírez 7 months ago
parent
commit
bcf56a5383
  1. 6
      tests/test_jsonable_encoder.py

6
tests/test_jsonable_encoder.py

@ -281,6 +281,12 @@ def test_encode_model_with_pure_windows_path():
assert jsonable_encoder(obj) == {"path": "\\foo\\bar"} assert jsonable_encoder(obj) == {"path": "\\foo\\bar"}
def test_encode_pure_path():
test_path = PurePath("/foo", "bar")
assert jsonable_encoder({"path": test_path}) == {"path": str(test_path)}
@needs_pydanticv1 @needs_pydanticv1
def test_encode_root(): def test_encode_root():
from pydantic import v1 from pydantic import v1

Loading…
Cancel
Save