-
-
Notifications
You must be signed in to change notification settings - Fork 52
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 #80 from ahopkins/dev
Version 1.0.1 [2018-02-27]
- Loading branch information
Showing
9 changed files
with
129 additions
and
73 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
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
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,30 @@ | ||
def test_preflight_authenticate(app): | ||
sanic_app, _ = app | ||
_, response = sanic_app.test_client.options('/auth') | ||
|
||
assert response.status == 204 | ||
assert not response.body | ||
|
||
|
||
def test_preflight_retrieve_user(app): | ||
sanic_app, _ = app | ||
_, response = sanic_app.test_client.options('/auth/me') | ||
|
||
assert response.status == 204 | ||
assert not response.body | ||
|
||
|
||
def test_preflight_verify(app): | ||
sanic_app, _ = app | ||
_, response = sanic_app.test_client.options('/auth/verify') | ||
|
||
assert response.status == 204 | ||
assert not response.body | ||
|
||
|
||
def test_preflight_refresh(app): | ||
sanic_app, _ = app | ||
_, response = sanic_app.test_client.options('/auth/refresh') | ||
|
||
assert response.status == 204 | ||
assert not response.body |
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,13 @@ | ||
from sanic.exceptions import abort | ||
|
||
|
||
def test_sanic_abort_401(app): | ||
sanic_app, _ = app | ||
|
||
@sanic_app.route("/abort") | ||
async def abort_request(request): | ||
abort(401) | ||
|
||
_, response = sanic_app.test_client.get('/abort') | ||
|
||
assert response.status == 401 |