Skip to content

Commit

Permalink
tests - fastapi model name generation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
commonism committed Oct 20, 2023
1 parent 30b3935 commit c073188
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/apiv1_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def randomPet(name=None):
@pytest.mark.skipif(sys.version_info < (3, 9), reason="requires asyncio.to_thread")
async def test_createPet(event_loop, server, client):
h, r = await asyncio.to_thread(client._.createPet, **randomPet())
assert type(r).model_json_schema() == client.components.schemas["Pet-Input"].get_type().model_json_schema()
assert type(r).model_json_schema() == client.components.schemas["Pet"].get_type().model_json_schema()
assert h["X-Limit-Remain"] == 5

r = await asyncio.to_thread(client._.createPet, data={"pet": {"name": r.name}})
Expand Down
2 changes: 1 addition & 1 deletion tests/apiv2_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ async def test_Request(event_loop, server, client):
@pytest.mark.asyncio
async def test_createPet(event_loop, server, client):
data = {
"pet": client.components.schemas["WhiteCat-Input"]
"pet": client.components.schemas["WhiteCat"]
.model(
{
"name": str(uuid.uuid4()),
Expand Down

0 comments on commit c073188

Please sign in to comment.