test_encode_class() — fastapi Function Reference
Architecture documentation for the test_encode_class() function in test_jsonable_encoder.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD ea43b46f_63a4_6e0e_cb54_afa4a4fa218d["test_encode_class()"] 80ce950d_4c72_e7d9_21bb_a5c60524786c["test_jsonable_encoder.py"] ea43b46f_63a4_6e0e_cb54_afa4a4fa218d -->|defined in| 80ce950d_4c72_e7d9_21bb_a5c60524786c 1ac1bc37_1a47_e7e2_9156_ab0473094700["jsonable_encoder()"] ea43b46f_63a4_6e0e_cb54_afa4a4fa218d -->|calls| 1ac1bc37_1a47_e7e2_9156_ab0473094700 style ea43b46f_63a4_6e0e_cb54_afa4a4fa218d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
tests/test_jsonable_encoder.py lines 99–109
def test_encode_class():
person = Person(name="Foo")
pet = Pet(owner=person, name="Firulais")
assert jsonable_encoder(pet) == {"name": "Firulais", "owner": {"name": "Foo"}}
assert jsonable_encoder(pet, include={"name"}) == {"name": "Firulais"}
assert jsonable_encoder(pet, exclude={"owner"}) == {"name": "Firulais"}
assert jsonable_encoder(pet, include={}) == {}
assert jsonable_encoder(pet, exclude={}) == {
"name": "Firulais",
"owner": {"name": "Foo"},
}
Domain
Subdomains
Defined In
Calls
Source
Frequently Asked Questions
What does test_encode_class() do?
test_encode_class() is a function in the fastapi codebase, defined in tests/test_jsonable_encoder.py.
Where is test_encode_class() defined?
test_encode_class() is defined in tests/test_jsonable_encoder.py at line 99.
What does test_encode_class() call?
test_encode_class() calls 1 function(s): jsonable_encoder.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free