Skip to content

Commit

Permalink
tests - pydantic release adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
commonism committed Aug 16, 2023
1 parent b3e2add commit 04053fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion aiopenapi3/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.3.0a6"
__version__ = "0.3.0a9"
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["PetInput"].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
8 changes: 4 additions & 4 deletions tests/apiv2_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ async def test_model(event_loop, server, client):

def randomPet(client, name=None, cat=False):
if name:
Pet = client.components.schemas["Pet-Input"].get_type()
Pet = client.components.schemas["PetInput"].get_type()
if not cat:
Dog = typing.get_args(typing.get_args(Pet.model_fields["root"].annotation)[0])[1]
dog = Dog(
Expand Down 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["WhiteCatInput"]
.model(
{
"name": str(uuid.uuid4()),
Expand All @@ -176,7 +176,7 @@ async def test_createPet(event_loop, server, client):

print(json.dumps(data["pet"], indent=4))
r = await client._.createPet(data=data)
assert isinstance(r, client.components.schemas["Pet-Input"].get_type())
assert isinstance(r, client.components.schemas["PetInput"].get_type())

r = await client._.createPet(data=randomPet(client, name=r.root.root.name))
Error = client.components.schemas["Error"].get_type()
Expand Down Expand Up @@ -223,7 +223,7 @@ async def test_deletePet(event_loop, server, client):

@pytest.mark.asyncio
async def test_patchPet(event_loop, server, client):
Pet = client.components.schemas["Pet-Input"].get_type()
Pet = client.components.schemas["PetInput"].get_type()
Dog = typing.get_args(typing.get_args(Pet.model_fields["root"].annotation)[0])[1]
pets = [
Pet(
Expand Down

0 comments on commit 04053fc

Please sign in to comment.