update
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import json
|
||||
import pprint
|
||||
from base64 import b64encode
|
||||
from http import HTTPMethod, HTTPStatus
|
||||
from urllib.parse import urlencode
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import json
|
||||
import pprint
|
||||
from base64 import b64encode
|
||||
from http import HTTPMethod, HTTPStatus
|
||||
from urllib.parse import urlencode
|
||||
@@ -125,3 +126,32 @@ def test_refresh_token(
|
||||
)
|
||||
|
||||
assert len(r['items']) == 2
|
||||
|
||||
|
||||
def test_refresh_token_invalid_grant(
|
||||
app,
|
||||
seeds,
|
||||
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
|
||||
http_api_proxy: HttpApiProxy,
|
||||
lambda_context: LambdaContext,
|
||||
):
|
||||
r = app.lambda_handler(
|
||||
http_api_proxy(
|
||||
raw_path='/token',
|
||||
method=HTTPMethod.POST,
|
||||
headers={
|
||||
'Authorization': f'Basic {AUTH}',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
body=urlencode(
|
||||
{
|
||||
'grant_type': 'refresh_token',
|
||||
'refresh_token': '1234',
|
||||
'client_id': CLIENT_ID,
|
||||
}
|
||||
),
|
||||
),
|
||||
lambda_context,
|
||||
)
|
||||
|
||||
assert r['statusCode'] == 400
|
||||
|
||||
Reference in New Issue
Block a user