This repository has been archived by the owner on Mar 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from lendingblock/master
0.5.0
- Loading branch information
Showing
7 changed files
with
137 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
"""Minimal OpenAPI asynchronous server application | ||
""" | ||
|
||
__version__ = '0.4.6' | ||
__version__ = '0.5.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from datetime import datetime | ||
from openapi.testing import jsonBody | ||
|
||
|
||
async def test_get_update(cli): | ||
response = await cli.post('/tasks', json=dict(title='test task2 2')) | ||
data = await jsonBody(response, 201) | ||
id_ = data['id'] | ||
assert data['title'] == 'test task2 2' | ||
# | ||
# now get it | ||
response = await cli.get(f'/tasks2/{id_}') | ||
data = await jsonBody(response, 200) | ||
assert data['title'] == 'test task2 2' | ||
# | ||
# now update | ||
response = await cli.patch( | ||
f'/tasks2/{id_}', json=dict(done=datetime.now().isoformat()) | ||
) | ||
data = await jsonBody(response, 200) | ||
assert data['id'] == id_ | ||
# | ||
# now delete it | ||
response = await cli.delete(f'/tasks2/{id_}') | ||
assert response.status == 204 | ||
response = await cli.delete(f'/tasks2/{id_}') | ||
await jsonBody(response, 404) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters